Skip to content

Commit 6029c77

Browse files
PowerShell splatting
1 parent 09eaf6f commit 6029c77

File tree

1 file changed

+24
-6
lines changed

1 file changed

+24
-6
lines changed

articles/virtual-desktop/configure-host-pool-load-balancing.md

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,27 +83,45 @@ Here's how to configure load balancing with Azure PowerShell.
8383
- To set breadth-first without adjusting the maximum session limit, run the following command:
8484

8585
```powershell
86-
Update-AzWvdHostPool -ResourceGroupName <ResourceGroupName> -Name <HostPoolName> -LoadBalancerType 'BreadthFirst'
86+
$parameters = @{
87+
Name = '<HostPoolName>'
88+
ResourceGroupName = '<ResourceGroupName>'
89+
LoadBalancerType = 'BreadthFirst'
90+
}
91+
92+
Update-AzWvdHostPool @parameters
8793
```
8894

8995
- To set depth-first and adjust the maximum session limit to 10, run the following command:
9096

9197
```powershell
92-
Update-AzWvdHostPool -ResourceGroupName <ResourceGroupName> -Name <HostPoolName> -LoadBalancerType 'DepthFirst' -MaxSessionLimit 10
98+
$parameters = @{
99+
Name = '<HostPoolName>'
100+
ResourceGroupName = '<ResourceGroupName>'
101+
LoadBalancerType = 'DepthFirst'
102+
MaxSessionLimit = '10'
103+
}
104+
105+
Update-AzWvdHostPool @parameters
93106
```
94107

95108
3. To make sure the setting has updated, run this command:
96109

97110
```powershell
98-
Get-AzWvdHostPool -ResourceGroupName <ResourceGroupName> -Name <HostPoolName> | Format-List Name, LoadBalancerType, MaxSessionLimit
111+
$parameters = @{
112+
Name = '<HostPoolName>'
113+
ResourceGroupName = '<ResourceGroupName>'
114+
}
115+
116+
Get-AzWvdHostPool @parameters | Format-Table Name, LoadBalancerType, MaxSessionLimit
99117
```
100118

101119
The output should be similar to the following output:
102120

103121
```output
104-
Name : contosohp01
105-
LoadBalancerType : DepthFirst
106-
MaxSessionLimit : 10
122+
Name LoadBalancerType MaxSessionLimit
123+
----------- ---------------- ---------------
124+
contosohp01 DepthFirst 10
107125
```
108126

109127
### [Azure CLI](#tab/cli)

0 commit comments

Comments
 (0)