Skip to content

Commit 0e1f16b

Browse files
committed
updated code
1 parent cbc3635 commit 0e1f16b

File tree

2 files changed

+13
-53
lines changed

2 files changed

+13
-53
lines changed

articles/update-center/manage-arc-enabled-servers-programmatically.md

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,18 +43,11 @@ The format of the request body for version 2020-08-15 is as follows:
4343

4444
# [Azure PowerShell](#tab/powershell)
4545

46-
To specify the POST request, you can use the Azure PowerShell [Invoke-AzRestMethod](/powershell/module/az.accounts/invoke-azrestmethod) cmdlet.
46+
To specify the POST request, you can use the Azure PowerShell [Invoke-AzRestMethod-Path](/powershell/module/az.accounts/invoke-azrestmethod) cmdlet.
4747

4848
```azurepowershell
49-
Invoke-AzRestMethod
50-
-ResourceGroupName resourceGroupName
51-
-Name "machineName"
52-
-ResourceProviderName "Microsoft.HybridCompute"
53-
-ResourceType "machines"
54-
-ApiVersion 2020-08-15-preview
55-
-Payload '{
56-
}'
57-
-Method POST
49+
Invoke-AzRestMethod-Path
50+
"/subscriptions/subscriptionId/resourceGroups/resourcegroupname/providers/Microsoft.HybridCompute/machines/machinename/assessPatches?api-version=2020-08-15-preview" -Payload '{}' -Method POST
5851
```
5952

6053
---

articles/update-center/manage-vms-programmatically.md

Lines changed: 10 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: This article tells how to use update management center (preview) in
44
ms.service: update-management-center
55
author: SnehaSudhirG
66
ms.author: sudhirsneha
7-
ms.date: 04/21/2022
7+
ms.date: 03/23/2023
88
ms.topic: conceptual
99
---
1010

@@ -26,26 +26,19 @@ POST on `subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers
2626

2727
# [Azure CLI](#tab/cli)
2828

29-
To specify the POST request, you can use the Azure CLI [az rest](/cli/azure/reference-index#az_rest) command.
29+
To specify the POST request, you can use the Azure CLI [az vm assess-patches](https://learn.microsoft.com/cli/azure/vm?view=azure-cli-latest#az-vm-assess-patches) command.
3030

3131
```azurecli
32-
az rest --method post --url https://management.azure.com/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.Compute/virtualMachines/virtualMachineName/assessPatches?api-version=2020-12-01
32+
az vm assess-patches -g MyResourceGroup -n MyVm
3333
```
3434

35+
3536
# [Azure PowerShell](#tab/powershell)
3637

37-
To specify the POST request, you can use the Azure PowerShell [Invoke-AzRestMethod](/powershell/module/az.accounts/invoke-azrestmethod) cmdlet.
38+
To specify the POST request, you can use the Azure PowerShell [Invoke-AzVMPatchAssessment](https://learn.microsoft.com/powershell/module/az.compute/invoke-azvmpatchassessment?view=azps-9.5.0) cmdlet.
3839

3940
```azurepowershell
40-
Invoke-AzRestMethod
41-
-ResourceGroupName resourceGroupName
42-
-Name "virtualMachineName"
43-
-ResourceProviderName "Microsoft.Compute"
44-
-ResourceType "virtualMachines"
45-
-ApiVersion xx
46-
-Payload '{
47-
}'
48-
-Method POST
41+
Invoke-AzVMPatchAssessment -ResourceGroupName "myRG" -VMName "myVM"
4942
```
5043

5144
---
@@ -107,10 +100,10 @@ POST on 'subscriptions/{subscriptionId}/resourceGroups/acmedemo/providers/Micros
107100

108101
# [Azure CLI](#tab/azurecli)
109102

110-
To specify the POST request, you can use the Azure CLI [az rest](/cli/azure/reference-index#az_rest) command.
103+
To specify the POST request, you can use the Azure CLI [az vm install-patches](https://learn.microsoft.com/cli/azure/vm?view=azure-cli-latest#az-vm-install-patches) command.
111104

112105
```azurecli
113-
az rest --method post --url https://management.azure.com/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.Compute/virtualMachines/virtualMachineName/installPatches?api-version=2020-12-01 @body.json
106+
az vm install-patches -g MyResourceGroup -n MyVm --maximum-duration PT4H --reboot-setting IfRequired --classifications-to-include-linux Critical
114107
```
115108

116109
The format of the request body for version 2020-12-01 is as follows:
@@ -140,36 +133,10 @@ The format of the request body for version 2020-12-01 is as follows:
140133

141134
# [Azure PowerShell](#tab/azurepowershell)
142135

143-
To specify the POST request, you can use the Azure PowerShell [Invoke-AzRestMethod](/powershell/module/az.accounts/invoke-azrestmethod) cmdlet.
136+
To specify the POST request, you can use the Azure PowerShell [Invoke-AzVMInstallPatch](/powershell/module/az.accounts/invoke-azrestmethod) cmdlet.
144137

145138
```azurepowershell
146-
Invoke-AzRestMethod
147-
-ResourceGroupName resourceGroupName
148-
-Name "machineName"
149-
-ResourceProviderName "Microsoft.Compute"
150-
-ResourceType "virtualMachines"
151-
-ApiVersion 2020-12-01-preview
152-
-Payload '{
153-
"maximumDuration": "PT120M",
154-
"rebootSetting": "IfRequired",
155-
"windowsParameters": {
156-
"classificationsToInclude": [
157-
"Security",
158-
"UpdateRollup",
159-
"FeaturePack",
160-
"ServicePack"
161-
],
162-
"kbNumbersToInclude": [
163-
"11111111111",
164-
"22222222222222"
165-
],
166-
"kbNumbersToExclude": [
167-
"333333333333",
168-
"55555555555"
169-
]
170-
}
171-
}'
172-
-Method POST
139+
Invoke-AzVmInstallPatch -ResourceGroupName 'MyRG' -VmName 'MyVM' -Windows -RebootSetting 'never' -MaximumDuration PT2H -ClassificationToIncludeForWindows Critical
173140
```
174141
---
175142

0 commit comments

Comments
 (0)