Skip to content

Commit 94ef378

Browse files
Merge pull request #244028 from cogran/patch-14
Update network-watcher-security-group-view-powershell.md
2 parents a9d12f5 + e3021e7 commit 94ef378

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

articles/network-watcher/network-watcher-security-group-view-powershell.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ The scenario covered in this article retrieves the configured and effective secu
4242
The first step is to retrieve the Network Watcher instance. This variable is passed to the `Get-AzNetworkWatcherSecurityGroupView` cmdlet.
4343

4444
```powershell
45-
$networkWatcher = Get-AzResource | Where {$_.ResourceType -eq "Microsoft.Network/networkWatchers" -and $_.Location -eq "WestCentralUS" }
45+
$nw = Get-AzResource | Where {$_.ResourceType -eq "Microsoft.Network/networkWatchers" -and $_.Location -eq "WestCentralUS" }
46+
$networkWatcher = Get-AzNetworkWatcher -Name $nw.Name -ResourceGroupName $nw.ResourceGroupName
4647
```
4748

4849
## Get a VM

0 commit comments

Comments
 (0)