Skip to content

Commit aea6551

Browse files
authored
Merge pull request #95322 from dorothyhu/dorothy/fix-doc
Update antimalware-code-samples.md
2 parents 9424027 + ad63356 commit aea6551

File tree

1 file changed

+25
-26
lines changed

1 file changed

+25
-26
lines changed

articles/security/fundamentals/antimalware-code-samples.md

Lines changed: 25 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ The code sample below shows how you can add Microsoft Antimalware for Azure Arc-
182182
183183
```powershell
184184
#Before using Azure PowerShell to manage VM extensions on your hybrid server managed by Azure Arc-enabled servers, you need to install the Az.ConnectedMachine module. Run the following command on your Azure Arc-enabled server:
185+
#If you have Az.ConnectedMachine installed, please make sure the version is at least 0.4.0
185186
install-module -Name Az.ConnectedMachine
186187
Import-Module -name Az.ConnectedMachine
187188
@@ -192,36 +193,34 @@ $resourceGroupName = " RESOURCE GROUP NAME HERE "
192193
$machineName = "MACHINE NAME HERE "
193194
194195
# Enable Antimalware with default policies
195-
$settingString = {"AntimalwareEnabled": true}’;
196+
$setting = @{"AntimalwareEnabled"=$true}
196197
# Enable Antimalware with custom policies
197-
# $settingString = ‘{
198-
# "AntimalwareEnabled": true,
199-
# "RealtimeProtectionEnabled": true,
200-
# "ScheduledScanSettings": {
201-
# "isEnabled": true,
202-
# "day": 0,
203-
# "time": 120,
204-
# "scanType": "Quick"
205-
# },
206-
# "Exclusions": {
207-
# "Extensions": ".ext1,.ext2",
208-
# "Paths":"",
209-
# "Processes":"sampl1e1.exe, sample2.exe"
210-
# },
211-
# "SignatureUpdates": {
212-
# "FileSharesSources": “”,
213-
# "FallbackOrder”: “”,
214-
# "ScheduleDay": 0,
215-
# "UpdateInterval": 0,
216-
# },
217-
# "CloudProtection": true
218-
#
219-
# }’;
220-
198+
$setting2 = @{
199+
"AntimalwareEnabled"=$true;
200+
"RealtimeProtectionEnabled"=$true;
201+
"ScheduledScanSettings"= @{
202+
"isEnabled"=$true;
203+
"day"=0;
204+
"time"=120;
205+
"scanType"="Quick"
206+
};
207+
"Exclusions"= @{
208+
"Extensions"=".ext1, .ext2";
209+
"Paths"="";
210+
"Processes"="sampl1e1.exe, sample2.exe"
211+
};
212+
"SignatureUpdates"= @{
213+
"FileSharesSources"=“”;
214+
"FallbackOrder”=“”;
215+
"ScheduleDay"=0;
216+
"UpdateInterval"=0;
217+
};
218+
"CloudProtection"=$true
219+
}
221220
# Will be prompted to login
222221
Connect-AzAccount
223222
# Enable Antimalware with the policies
224-
New-AzConnectedMachineExtension -Name "IaaSAntimalware" -ResourceGroupName $resourceGroupName -MachineName $machineName -Location $location -SubscriptionId $subscriptionid -Publisher “Microsoft.Azure.Security” -Settings $settingString -ExtensionType “IaaSAntimalware”
223+
New-AzConnectedMachineExtension -Name "IaaSAntimalware" -ResourceGroupName $resourceGroupName -MachineName $machineName -Location $location -SubscriptionId $subscriptionid -Publisher “Microsoft.Azure.Security” -Settings $setting -ExtensionType “IaaSAntimalware”
225224
```
226225

227226
## Next steps

0 commit comments

Comments
 (0)