-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update Invoke-AzVMRunCommand.md with more Windows Examples #23693
Conversation
Added more examples to educate Microsoft Learn readers on how to run cmdlets and script blocks using Invoke-AzVMRunCommand. This will help readers understand that the ScriptBlock parameter in PowerShell Invoke-Command cmdlet can also be worked around in Az PowerShell.
|
Type | Cmdlet | Example | Line | RuleName | Description | Extent | Remediation |
---|---|---|---|---|---|---|---|
Invoke-AzVMRunCommand | 3 | 12 | Mismatched_Parameter_Value_Type | Invoke-AzVMRunCommand -ScriptString $Script is not an expected parameter value type. | -ScriptString | Use correct parameter value type. Expected Type is string. Now the type is scriptblock.(Type). | |
Invoke-AzVMRunCommand | 3 | 6 | Unassigned_Variable | Set-TimeZone -Id $NewTimeZone is a null-valued parameter value. | -Id | Assign value for $NewTimeZone. |
⚠️ Windows PowerShell - Windows
Type | Cmdlet | Example | Line | RuleName | Description | Extent | Remediation |
---|---|---|---|---|---|---|---|
Invoke-AzVMRunCommand | 3 | 12 | Mismatched_Parameter_Value_Type | Invoke-AzVMRunCommand -ScriptString $Script is not an expected parameter value type. | -ScriptString | Use correct parameter value type. Expected Type is string. Now the type is scriptblock.(Type). | |
Invoke-AzVMRunCommand | 3 | 6 | Unassigned_Variable | Set-TimeZone -Id $NewTimeZone is a null-valued parameter value. | -Id | Assign value for $NewTimeZone. |
️✔️Help File Existence Check
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
Thank you for your contribution Toluwaloope! We will review the pull request and get back to you soon. |
@microsoft-github-policy-service agree company="Igloo Software" |
Hi @Sandido , could you please help to valiate the examples? |
/azp run azure-powershell - security-tools |
Azure Pipelines successfully started running 1 pipeline(s). |
|
Hi @Sandido, @haagha and @grizzlytheodore, could you please review the examples? I thinks they are fine. |
Added more examples to educate Microsoft Learn readers on how to run cmdlets and script blocks using Invoke-AzVMRunCommand. This will help readers understand that the ScriptBlock parameter in PowerShell Invoke-Command cmdlet can also be worked around in Az PowerShell.
Description
Mandatory Checklist
Please choose the target release of Azure PowerShell
Check this box to confirm: I have read the Submitting Changes section of
CONTRIBUTING.md
and reviewed the following information:ChangeLog.md
file(s) appropriatelysrc/{{SERVICE}}/{{SERVICE}}/ChangeLog.md
.## Upcoming Release
header in the past tense.ChangeLog.md
if no new release is required, such as fixing test case only.