Skip to content

Commit 6b9d283

Browse files
authored
Merge pull request #54445 from michawets/patch-9
Reduced possible typo's by using Out-Gridviews
2 parents 55b3e8d + a4d1649 commit 6b9d283

File tree

1 file changed

+21
-25
lines changed

1 file changed

+21
-25
lines changed

articles/virtual-desktop/virtual-desktop-fall-2019/set-up-scaling-script.md

Lines changed: 21 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -170,42 +170,38 @@ Finally, you'll need to create the Azure Logic App and set up an execution sched
170170
5. Run the following PowerShell script to create the Azure Logic app and execution schedule.
171171
172172
```powershell
173-
$resourceGroupName = Read-Host -Prompt "Enter the name of the resource group for the new Azure Logic App"
173+
$aadTenantId = (Get-AzContext).Tenant.Id
174+
175+
$azureSubscription = Get-AzSubscription | Out-GridView -PassThru -Title "Select your Azure Subscription"
176+
Select-AzSubscription -Subscription $azureSubscription.Id
177+
$subscriptionId = $azureSubscription.Id
178+
179+
$resourceGroup = Get-AzResourceGroup | Out-GridView -PassThru -Title "Select the resource group for the new Azure Logic App"
180+
$resourceGroupName = $resourceGroup.ResourceGroupName
181+
$location = $resourceGroup.Location
182+
183+
$wvdTenant = Get-RdsTenant | Out-GridView -PassThru -Title "Select your WVD tenant"
184+
$tenantName = $wvdTenant.TenantName
185+
186+
$wvdHostpool = Get-RdsHostPool -TenantName $wvdTenant.TenantName | Out-GridView -PassThru -Title "Select the host pool you'd like to scale"
187+
$hostPoolName = $wvdHostpool.HostPoolName
174188
175-
$aadTenantId = Read-Host -Prompt "Enter your Azure AD tenant ID"
176-
177-
$subscriptionId = Read-Host -Prompt "Enter your Azure Subscription ID"
178-
179-
$tenantName = Read-Host -Prompt "Enter the name of your WVD tenant"
180-
181-
$hostPoolName = Read-Host -Prompt "Enter the name of the host pool you'd like to scale"
182-
183189
$recurrenceInterval = Read-Host -Prompt "Enter how often you'd like the job to run in minutes, e.g. '15'"
184-
185190
$beginPeakTime = Read-Host -Prompt "Enter the start time for peak hours in local time, e.g. 9:00"
186-
187191
$endPeakTime = Read-Host -Prompt "Enter the end time for peak hours in local time, e.g. 18:00"
188-
189192
$timeDifference = Read-Host -Prompt "Enter the time difference between local time and UTC in hours, e.g. +5:30"
190-
191193
$sessionThresholdPerCPU = Read-Host -Prompt "Enter the maximum number of sessions per CPU that will be used as a threshold to determine when new session host VMs need to be started during peak hours"
192-
193194
$minimumNumberOfRdsh = Read-Host -Prompt "Enter the minimum number of session host VMs to keep running during off-peak hours"
194-
195195
$limitSecondsToForceLogOffUser = Read-Host -Prompt "Enter the number of seconds to wait before automatically signing out users. If set to 0, users will be signed out immediately"
196-
197196
$logOffMessageTitle = Read-Host -Prompt "Enter the title of the message sent to the user before they are forced to sign out"
198-
199197
$logOffMessageBody = Read-Host -Prompt "Enter the body of the message sent to the user before they are forced to sign out"
200-
201-
$location = Read-Host -Prompt "Enter the name of the Azure region where you will be creating the logic app"
202-
203-
$connectionAssetName = Read-Host -Prompt "Enter the name of the Azure RunAs connection asset"
204-
198+
199+
$automationAccount = Get-AzAutomationAccount -ResourceGroupName $resourceGroup.ResourceGroupName | Out-GridView -PassThru
200+
$automationAccountName = $automationAccount.AutomationAccountName
201+
$automationAccountConnection = Get-AzAutomationConnection -ResourceGroupName $resourceGroup.ResourceGroupName -AutomationAccountName $automationAccount.AutomationAccountName | Out-GridView -PassThru -Title "Select the Azure RunAs connection asset"
202+
$connectionAssetName = $automationAccountConnection.Name
203+
205204
$webHookURI = Read-Host -Prompt "Enter the URI of the WebHook returned by when you created the Azure Automation Account"
206-
207-
$automationAccountName = Read-Host -Prompt "Enter the name of the Azure Automation Account"
208-
209205
$maintenanceTagName = Read-Host -Prompt "Enter the name of the Tag associated with VMs you don't want to be managed by this scaling tool"
210206
211207
.\createazurelogicapp.ps1 -ResourceGroupName $resourceGroupName `

0 commit comments

Comments
 (0)