Skip to content

Commit 797b88d

Browse files
Merge pull request #302028 from dominicbetts/aio-tutorial-pwrsh-scripts
AIO: Tutorial fix Powershell script
2 parents 44828e7 + a1b2344 commit 797b88d

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

articles/iot-operations/end-to-end-tutorials/tutorial-add-assets.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ kubectl patch secret opc-plc-trust-list -n azure-iot-operations -p "{\"data\": $
8989
```
9090

9191
```powershell
92-
$cert = kubectl -n azure-iot-operations get secret aio-opc-opcuabroker-default-application-cert -o jsonpath='{.data.tls\.crt}' | base64 -d
92+
$cert = kubectl -n azure-iot-operations get secret aio-opc-opcuabroker-default-application-cert -o jsonpath='{.data.tls\.crt}' | %{ [Text.Encoding]::UTF8.GetString([Convert]::FromBase64String($_)) }
9393
$data = kubectl create secret generic temp --from-literal=opcuabroker.crt="$cert" --dry-run=client -o jsonpath='{.data}'
9494
kubectl patch secret opc-plc-trust-list -n azure-iot-operations -p "{""data"": $data}"
9595
```
@@ -98,10 +98,14 @@ kubectl patch secret opc-plc-trust-list -n azure-iot-operations -p "{""data"": $
9898

9999
Every OPC UA server type has its own mechanism for managing its application instance certificate. To download the simulator's certificate to a file called `opcplc-000000.crt`, run the following command:
100100

101-
```console
101+
```bash
102102
kubectl -n azure-iot-operations get secret opc-plc-default-application-cert -o jsonpath='{.data.tls\.crt}' | base64 -d > opcplc-000000.crt
103103
```
104104

105+
```powershell
106+
kubectl -n azure-iot-operations get secret opc-plc-default-application-cert -o jsonpath='{.data.tls\.crt}' | %{ [Text.Encoding]::UTF8.GetString([Convert]::FromBase64String($_)) } > opcplc-000000.crt
107+
```
108+
105109
To add the simulator's certificate to the connector's trust list:
106110

107111
1. Go to the [operations experience](https://iotoperations.azure.com) web UI and sign in with your Microsoft Entra ID credentials.

0 commit comments

Comments
 (0)