Skip to content

Commit 70661ba

Browse files
committed
PowerShell splatting
1 parent b568bbe commit 70661ba

File tree

1 file changed

+42
-6
lines changed

1 file changed

+42
-6
lines changed

articles/virtual-desktop/private-link-setup.md

Lines changed: 42 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -789,39 +789,75 @@ With Azure Virtual Desktop, you can independently control public traffic for wor
789789
1. In the same PowerShell session, you can disable public access and use private access by running the following command:
790790

791791
```azurepowershell
792-
Update-AzWvdworkspace -Name <WorkspaceName> -ResourceGroup <ResourceGroupName> -PublicNetworkAccess Disabled
792+
$parameters = @{
793+
Name = '<WorkspaceName>'
794+
ResourceGroupName = '<ResourceGroupName>'
795+
PublicNetworkAccess = 'Disabled'
796+
}
797+
798+
Update-AzWvdWorkspace @parameters
793799
```
794800

795801
1. To enable public access from all networks, run the following command:
796802

797803
```azurepowershell
798-
Update-AzWvdworkspace -Name <WorkspaceName> -ResourceGroup <ResourceGroupName> -PublicNetworkAccess Enabled
804+
$parameters = @{
805+
Name = '<WorkspaceName>'
806+
ResourceGroupName = '<ResourceGroupName>'
807+
PublicNetworkAccess = 'Enabled'
808+
}
809+
810+
Update-AzWvdWorkspace @parameters
799811
```
800812

801813
#### Host pools
802814

803815
1. In the same PowerShell session, you can disable public access and use private access by running the following command:
804816

805817
```azurepowershell
806-
Update-AzWvdHostPool -Name <HostPoolName> -ResourceGroup <ResourceGroupName> -PublicNetworkAccess Disabled
818+
$parameters = @{
819+
Name = '<HostPoolName>'
820+
ResourceGroupName = '<ResourceGroupName>'
821+
PublicNetworkAccess = 'Disabled'
822+
}
823+
824+
Update-AzWvdHostPool @parameters
807825
```
808826

809827
1. To enable public access from all networks, run the following command:
810828

811829
```azurepowershell
812-
Update-AzWvdHostPool -Name <HostPoolName> -ResourceGroup <ResourceGroupName> -PublicNetworkAccess Enabled
830+
$parameters = @{
831+
Name = '<HostPoolName>'
832+
ResourceGroupName = '<ResourceGroupName>'
833+
PublicNetworkAccess = 'Enabled'
834+
}
835+
836+
Update-AzWvdHostPool @parameters
813837
```
814838

815839
1. To use public access for end users, but use private access for session hosts, run the following command:
816840

817841
```azurepowershell
818-
Update-AzWvdHostPool -Name <HostPoolName> -ResourceGroup <ResourceGroupName> -PublicNetworkAccess EnabledForSessionHostsOnly
842+
$parameters = @{
843+
Name = '<HostPoolName>'
844+
ResourceGroupName = '<ResourceGroupName>'
845+
PublicNetworkAccess = 'EnabledForSessionHostsOnly'
846+
}
847+
848+
Update-AzWvdHostPool @parameters
819849
```
820850

821851
1. To use private access for end users, but use public access for session hosts, run the following command:
822852

823853
```azurepowershell
824-
Update-AzWvdHostPool -Name <HostPoolName> -ResourceGroup <ResourceGroupName> -PublicNetworkAccess EnabledForClientsOnly
854+
$parameters = @{
855+
Name = '<HostPoolName>'
856+
ResourceGroupName = '<ResourceGroupName>'
857+
PublicNetworkAccess = 'EnabledForClientsOnly'
858+
}
859+
860+
Update-AzWvdHostPool @parameters
825861
```
826862

827863
---

0 commit comments

Comments
 (0)