Skip to content

Commit 1a40cb7

Browse files
committed
Minor cmdlet help description changes
1 parent f6c711d commit 1a40cb7

File tree

2 files changed

+51
-15
lines changed

2 files changed

+51
-15
lines changed

src/Compute/Compute/help/Set-AzVMRunCommand.md

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,45 +27,45 @@ The operation to create or update the run command.
2727

2828
## EXAMPLES
2929

30-
### Example 1: Create or update Run Command on a VM using a storage blob SAS URL
30+
### Example 1: Create or update Run Command on a VM using SourceScriptUri (storage blob SAS URL).
3131

3232
```powershell
3333
Set-AzVMRunCommand -ResourceGroupName MyRG0 -VMName MyVMEE -RunCommandName MyRunCommand -Location EastUS2EUAP -SourceScriptUri "https://myst.blob.core.windows.net/mycontainer/myscript.ps1?sp=r&st=2022-10-27T21:02:35Z&se=2022-10-28T05:02:35Z&spr=https&sv=2021-06-08&sr=b&sig=0I%2FIiYayRwHasfasasfdasdfasdeTsQjLnpZjA%3D"
3434
```
3535

3636
Create or update Run Command on a Windows VM using a SAS URL of a storage blob that contains .ps1 script. Note SAS URL must provide read access to the blob. An expiry time of 24 hours is suggested for SAS URL. SAS URLs can be generated on Azure portal using blob's options , or SAS token using New-AzStorageBlobSASToken. If generating SAS token using New-AzStorageBlobSASToken, your SAS URL = base blob URL + "?" + SAS token from New-AzStorageBlobSASToken.
3737

38-
### Example 2: Create or update Run Command on a VM using a local script file.
38+
### Example 2: Create or update Run Command on a VM using ScriptLocalPath (local script file).
3939

4040
```powershell
4141
Set-AzVMRunCommand -ResourceGroupName MyRG0 -VMName MyVMEE -RunCommandName MyRunCommand -Location EastUS2EUAP -ScriptLocalPath "C:\MyScriptsDir\MyScript.ps1"
4242
```
4343

4444
Create or update Run Command on a VM using a local script file that is on the client machine where cmdlet is executed.
4545

46-
### Example 3: Create or update Run Command on a VM using script text.
46+
### Example 3: Create or update Run Command on a VM using SourceScript (script text).
4747

4848
```powershell
4949
Set-AzVMRunCommand -ResourceGroupName MyRG0 -VMName MyVML -RunCommandName MyRunCommand2 -Location EastUS2EUAP -SourceScript "id; echo HelloWorld"
5050
```
5151

5252
Create or update Run Command on a VM passing the script content directly to -SourceScript parameter. Use ';' to delimit multiple commands.
5353

54-
### Example 4: Create or update Run Command on a VM using commandId.
54+
### Example 4: Create or update Run Command on a VM using SourceCommandId.
5555

5656
```powershell
5757
Set-AzVMRunCommand -ResourceGroupName MyRG0 -VMName MyVMEE -RunCommandName MyRunCommand -Location EastUS2EUAP -SourceCommandId DisableWindowsUpdate
5858
```
5959

6060
Create or update Run Command on a VM using pre-existing commandId. Available commandIds can be retrieved using Get-AzVMRunCommandDocument.
6161

62-
### Example 5: Create or update Run Command on a VM and stream standard output and standard error messages to output and error Append blobs.
62+
### Example 5: Create or update Run Command on a VM using OutputBlobUri, ErrorBlobUri to stream standard output and standard error messages to output and error Append blobs.
6363

6464
```powershell
65-
Set-AzVMRunCommand -ResourceGroupName MyRG0 -VMName MyVML -RunCommandName MyRunCommand3 -Location EastUS2EUAP -ScriptLocalPath "C:\MyScriptsDir\MyScript.ps1" -OutputBlobUri "https://vivst.blob.core.windows.net/vivcontainer/output.txt?sp=racw&st=2022-10-27T22:18:36Z&se=2022-10-28T06:18:36Z&spr=https&sv=2021-06-08&sr=b&sig=HQAu3Bl%2BKMofYTjMo8o5hasfadsfasdF4jIkRJra4S5FlEo%3D" -ErrorBlobUri "https://vivst.blob.core.windows.net/vivcontainer/error.txt?sp=racw&st=2022-10-27T22:18:36Z&se=2022-10-28T06:18:36Z&spr=https&sv=2021-06-08&sr=b&sig=HQAu3Bl%2BKMofYTjMo8o5h%asfasdfgdT%2F4jasfasdf5FlEo%3D"
65+
Set-AzVMRunCommand -ResourceGroupName MyRG0 -VMName MyVML -RunCommandName MyRunCommand3 -Location EastUS2EUAP -ScriptLocalPath "C:\MyScriptsDir\MyScript.ps1" -OutputBlobUri "https://myst.blob.core.windows.net/mycontainer/output.txt?sp=racw&st=2022-10-27T22:18:36Z&se=2022-10-28T06:18:36Z&spr=https&sv=2021-06-08&sr=b&sig=HQAu3Bl%2BKMofYTjMo8o5hasfadsfasdF4jIkRJra4S5FlEo%3D" -ErrorBlobUri "https://myst.blob.core.windows.net/mycontainer/error.txt?sp=racw&st=2022-10-27T22:18:36Z&se=2022-10-28T06:18:36Z&spr=https&sv=2021-06-08&sr=b&sig=HQAu3Bl%2BKMofYTjMo8o5h%asfasdfgdT%2F4jasfasdf5FlEo%3D"
6666
```
6767

68-
Create or update Run Command on a VM and stream standard output and standard error messages to output and error Append blobs. Note output and error blobs must be of type AppendBlob and their SAS URLs must provide read, append, create, write access to the blob. An expiry time of 24 hours is suggested for SAS URL. If output or error blob does not exist, a blob of type AppendBlob will be created. SAS URLs can be generated on Azure portal using blob's options , or SAS token using New-AzStorageBlobSASToken. If generating SAS token using New-AzStorageBlobSASToken, your SAS URL = base blob URL + "?" + SAS token from New-AzStorageBlobSASToken.
68+
Create or update Run Command on a VM and stream standard output and standard error messages to output and error Append blobs. Note output and error blobs must be of type AppendBlob and their SAS URLs must provide read, append, create, write access to the blob. An expiry time of 24 hours is suggested for SAS URL. If output or error blob does not exist, a blob of type AppendBlob will be created. SAS URLs can be generated on Azure portal using blob's options , or SAS token using New-AzStorageBlobSASToken. If generating SAS token using New-AzStorageBlobSASToken, SAS URL = base blob URL + "?" + SAS token from New-AzStorageBlobSASToken.
6969

7070
### Example 6: Create or update Run Command on a VM, run the Run Command as a different user using RunAsUser and RunAsPassword parameters.
7171

@@ -75,6 +75,24 @@ Set-AzVMRunCommand -ResourceGroupName MyRG0 -VMName MyVMEE -RunCommandName MyRun
7575

7676
Create or update Run Command on a VM, run the Run Command as a different user using RunAsUser and RunAsPassword parameters. For RunAs to work properly, contact admin of VM and make sure user is added on the VM, user has access to resources accessed by the Run Command (Directories, Files, Network etc.), and in case of Windows VM, 'Secondary Logon' service is running on the VM.
7777

78+
### Example 7: Create or update Run Command on a VM instance using Parameter and ProtectedParameter parameters (Public and Protected Parameters to script)
79+
80+
```powershell
81+
$PublicParametersArray = @([Microsoft.Azure.PowerShell.Cmdlets.Compute.Models.Api20210701.IRunCommandInputParameter]@{name='publicParam1';value='publicParam1value'},
82+
>> [Microsoft.Azure.PowerShell.Cmdlets.Compute.Models.Api20210701.IRunCommandInputParameter]@{name='publicParam2';value='publicParam2value'})
83+
84+
$ProtectedParametersArray = @([Microsoft.Azure.PowerShell.Cmdlets.Compute.Models.Api20210701.IRunCommandInputParameter]@{name='secret1';value='secret1value'},
85+
>> [Microsoft.Azure.PowerShell.Cmdlets.Compute.Models.Api20210701.IRunCommandInputParameter]@{name='secret2';value='secret2value'})
86+
87+
Set-AzVMRunCommand -ResourceGroupName MyRG0 -VMName MyVMEE -RunCommandName MyRunCommand -Location EastUS2EUAP -SourceScriptUri "https://myst.blob.core.windows.net/mycontainer/myscript.ps1?sp=r&st=2022-10-27T21:02:35Z&se=2022-10-28T05:02:35Z&spr=https&sv=2021-06-08&sr=b&sig=0I%2FIiYayRwHasfasasfdasdfasdeTsQjLnpZjA%3D" -Parameter $PublicParametersArray -ProtectedParameter $ProtectedParametersArray
88+
```
89+
90+
Use ProtectedParameter to pass any sensitive inputs to script such as passwords, keys etc.
91+
92+
Windows: Parameters and ProtectedParameters are passed to script as arguments are passed to script and run like this - "myscript.ps1 -publicParam1 publicParam1value -publicParam2 publicParam2value -secret1 secret1value -secret2 secret2value"
93+
94+
Linux: Named Parameters and its values are set to environment config, which should be accessible within the .sh script. For Nameless arguments, pass an empty string to name input. Nameless arguments are passed to script and run like this - "myscript.sh publicParam1value publicParam2value secret1value secret2value"
95+
7896
## PARAMETERS
7997

8098
### -AsJob

src/Compute/Compute/help/Set-AzVmssVMRunCommand.md

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,45 +27,45 @@ The operation to create or update the VMSS VM run command.
2727

2828
## EXAMPLES
2929

30-
### Example 1: Create or update Run Command on a VMSS VM instance using a storage blob SAS URL
30+
### Example 1: Create or update Run Command on a VMSS VM instance using SourceScriptUri (storage blob SAS URL).
3131

3232
```powershell
3333
Set-AzVmssVMRunCommand -ResourceGroupName MyRG0 -VMScaleSetName MyVMSS -InstanceId 0 -RunCommandName MyRunCommand -Location EastUS2EUAP -SourceScriptUri "https://myst.blob.core.windows.net/mycontainer/myscript.ps1?sp=r&st=2022-10-27T21:02:35Z&se=2022-10-28T05:02:35Z&spr=https&sv=2021-06-08&sr=b&sig=0I%2FIiYayRwHasfasasfdasdfasdeTsQjLnpZjA%3D"
3434
```
3535

36-
Create or update Run Command on a Windows VMSS VM instance using a SAS URL of a storage blob that contains .ps1 script. Note SAS URL must provide read access to the blob. An expiry time of 24 hours is suggested for SAS URL. SAS URLs can be generated on Azure portal using blob's options , or SAS token using New-AzStorageBlobSASToken. If generating SAS token using New-AzStorageBlobSASToken, your SAS URL = base blob URL + "?" + SAS token from New-AzStorageBlobSASToken.
36+
Create or update Run Command on a Windows VMSS VM instance using a SAS URL of a storage blob that contains .ps1 script. Note SAS URL must provide read access to the blob. An expiry time of 24 hours is suggested for SAS URL. SAS URLs can be generated on Azure portal using blob's options , or SAS token using New-AzStorageBlobSASToken. If generating SAS token using New-AzStorageBlobSASToken, SAS URL = base blob URL + "?" + SAS token from New-AzStorageBlobSASToken.
3737

38-
### Example 2: Create or update Run Command on a VMSS VM instance using a local script file.
38+
### Example 2: Create or update Run Command on a VMSS VM instance using ScriptLocalPath (local script file).
3939

4040
```powershell
4141
Set-AzVmssVMRunCommand -ResourceGroupName MyRG0 -VMScaleSetName MyVMSS -InstanceId 0 -RunCommandName MyRunCommand -Location EastUS2EUAP -ScriptLocalPath "C:\MyScriptsDir\MyScript.ps1"
4242
```
4343

4444
Create or update Run Command on a VMSS VM instance using a local script file that is on the client machine where cmdlet is executed.
4545

46-
### Example 3: Create or update Run Command on a VMSS VM instance using script text.
46+
### Example 3: Create or update Run Command on a VMSS VM instance using SourceScript (script text).
4747

4848
```powershell
4949
Set-AzVmssVMRunCommand -ResourceGroupName MyRG0 -VMScaleSetName MyVMSSL -InstanceId 1 -RunCommandName MyRunCommand2 -Location EastUS2EUAP -SourceScript "id; echo HelloWorld"
5050
```
5151

5252
Create or update Run Command on a VMSS VM instance passing the script content directly to -SourceScript parameter. Use ';' to delimit multiple commands.
5353

54-
### Example 4: Create or update Run Command on a VMSS VM instance using commandId.
54+
### Example 4: Create or update Run Command on a VMSS VM instance using SourceCommandId.
5555

5656
```powershell
5757
Set-AzVmssVMRunCommand -ResourceGroupName MyRG0 -VMScaleSetName MyVMSS -InstanceId 0 -RunCommandName MyRunCommand -Location EastUS2EUAP -SourceCommandId DisableWindowsUpdate
5858
```
5959

6060
Create or update Run Command on a VMSS VM instance using pre-existing commandId. Available commandIds can be retrieved using Get-AzVMRunCommandDocument.
6161

62-
### Example 5: Create or update Run Command on a VMSS VM instance and stream standard output and standard error messages to output and error Append blobs.
62+
### Example 5: Create or update Run Command on a VMSS VM instance using OutputBlobUri, ErrorBlobUri to stream standard output and standard error messages to output and error Append blobs.
6363

6464
```powershell
65-
Set-AzVmssVMRunCommand -ResourceGroupName MyRG0 -VMScaleSetName MyVMSS -InstanceId 1 -RunCommandName MyRunCommand3 -Location EastUS2EUAP -ScriptLocalPath "C:\MyScriptsDir\MyScript.ps1" -OutputBlobUri "https://vivst.blob.core.windows.net/vivcontainer/output.txt?sp=racw&st=2022-10-27T22:18:36Z&se=2022-10-28T06:18:36Z&spr=https&sv=2021-06-08&sr=b&sig=HQAu3Bl%2BKMofYTjMo8o5hasfadsfasdF4jIkRJra4S5FlEo%3D" -ErrorBlobUri "https://vivst.blob.core.windows.net/vivcontainer/error.txt?sp=racw&st=2022-10-27T22:18:36Z&se=2022-10-28T06:18:36Z&spr=https&sv=2021-06-08&sr=b&sig=HQAu3Bl%2BKMofYTjMo8o5h%asfasdfgdT%2F4jasfasdf5FlEo%3D"
65+
Set-AzVmssVMRunCommand -ResourceGroupName MyRG0 -VMScaleSetName MyVMSS -InstanceId 1 -RunCommandName MyRunCommand3 -Location EastUS2EUAP -ScriptLocalPath "C:\MyScriptsDir\MyScript.ps1" -OutputBlobUri "https://myst.blob.core.windows.net/mycontainer/output.txt?sp=racw&st=2022-10-27T22:18:36Z&se=2022-10-28T06:18:36Z&spr=https&sv=2021-06-08&sr=b&sig=HQAu3Bl%2BKMofYTjMo8o5hasfadsfasdF4jIkRJra4S5FlEo%3D" -ErrorBlobUri "https://myst.blob.core.windows.net/mycontainer/error.txt?sp=racw&st=2022-10-27T22:18:36Z&se=2022-10-28T06:18:36Z&spr=https&sv=2021-06-08&sr=b&sig=HQAu3Bl%2BKMofYTjMo8o5h%asfasdfgdT%2F4jasfasdf5FlEo%3D"
6666
```
6767

68-
Create or update Run Command on a VMSS VM instance and stream standard output and standard error messages to output and error Append blobs. Note output and error blobs must be of type AppendBlob and their SAS URLs must provide read, append, create, write access to the blob. An expiry time of 24 hours is suggested for SAS URL. If output or error blob does not exist, a blob of type AppendBlob will be created. SAS URLs can be generated on Azure portal using blob's options , or SAS token using New-AzStorageBlobSASToken. If generating SAS token using New-AzStorageBlobSASToken, your SAS URL = base blob URL + "?" + SAS token from New-AzStorageBlobSASToken.
68+
Create or update Run Command on a VMSS VM instance and stream standard output and standard error messages to output and error Append blobs. Note output and error blobs must be of type AppendBlob and their SAS URLs must provide read, append, create, write access to the blob. An expiry time of 24 hours is suggested for SAS URL. If output or error blob does not exist, a blob of type AppendBlob will be created. SAS URLs can be generated on Azure portal using blob's options , or SAS token using New-AzStorageBlobSASToken. If generating SAS token using New-AzStorageBlobSASToken, SAS URL = base blob URL + "?" + SAS token from New-AzStorageBlobSASToken.
6969

7070
### Example 6: Create or update Run Command on a VMSS VM instance, run the Run Command as a different user using RunAsUser and RunAsPassword parameters.
7171

@@ -75,6 +75,24 @@ Set-AzVmssVMRunCommand -ResourceGroupName MyRG0 -VMScaleSetName MyVMSS -Instance
7575

7676
Create or update Run Command on a VMSS VM instance, run the Run Command as a different user using RunAsUser and RunAsPassword parameters. For RunAs to work properly, contact admin of VM and make sure user is added on the VM, user has access to resources accessed by the Run Command (Directories, Files, Network etc.), and in case of Windows VM, 'Secondary Logon' service is running on the VM.
7777

78+
### Example 7: Create or update Run Command on a VMSS VM instance using Parameter and ProtectedParameter parameters (Public and Protected Parameters to script)
79+
80+
```powershell
81+
$PublicParametersArray = @([Microsoft.Azure.PowerShell.Cmdlets.Compute.Models.Api20210701.IRunCommandInputParameter]@{name='publicParam1';value='publicParam1value'},
82+
>> [Microsoft.Azure.PowerShell.Cmdlets.Compute.Models.Api20210701.IRunCommandInputParameter]@{name='publicParam2';value='publicParam2value'})
83+
84+
$ProtectedParametersArray = @([Microsoft.Azure.PowerShell.Cmdlets.Compute.Models.Api20210701.IRunCommandInputParameter]@{name='secret1';value='secret1value'},
85+
>> [Microsoft.Azure.PowerShell.Cmdlets.Compute.Models.Api20210701.IRunCommandInputParameter]@{name='secret2';value='secret2value'})
86+
87+
Set-AzVmssVMRunCommand -ResourceGroupName MyRG0 -VMScaleSetName MyVMSS -InstanceId 1 -RunCommandName MyRunCommand -Location EastUS2EUAP -SourceScriptUri "https://myst.blob.core.windows.net/mycontainer/myscript.ps1?sp=r&st=2022-10-27T21:02:35Z&se=2022-10-28T05:02:35Z&spr=https&sv=2021-06-08&sr=b&sig=0I%2FIiYayRwHasfasasfdasdfasdeTsQjLnpZjA%3D" -Parameter $PublicParametersArray -ProtectedParameter $ProtectedParametersArray
88+
```
89+
90+
Use ProtectedParameter to pass any sensitive inputs to script such as passwords, keys etc.
91+
92+
Windows: Parameters and ProtectedParameters are passed to script as arguments are passed to script and run like this - "myscript.ps1 -publicParam1 publicParam1value -publicParam2 publicParam2value -secret1 secret1value -secret2 secret2value"
93+
94+
Linux: Named Parameters and its values are set to environment config, which should be accessible within the .sh script. For Nameless arguments, pass an empty string to name input. Nameless arguments are passed to script and run like this - "myscript.sh publicParam1value publicParam2value secret1value secret2value"
95+
7896
## PARAMETERS
7997

8098
### -AsJob

0 commit comments

Comments
 (0)