diff --git a/scripts/01Lab/02_Cluster.ps1 b/scripts/01Lab/02_Cluster.ps1 index 54aac89..4dc3047 100644 --- a/scripts/01Lab/02_Cluster.ps1 +++ b/scripts/01Lab/02_Cluster.ps1 @@ -395,7 +395,7 @@ try { # Set-AzContext -SubscriptionName $subscription -ErrorAction Stop # Allow user to select Resource Group - $resourceGroup = Get-Option "Get-AzResourceGroup" "ResourceGroupName" + $resourceGroupName = Get-Option "Get-AzResourceGroup" "ResourceGroupName" $TenantID = (Get-AzContext).Tenant.Id $SubscriptionID = (Get-AzContext).Subscription.Id @@ -429,7 +429,7 @@ Invoke-AzStackHciArcInitialization -SubscriptionID $SubscriptionID ` Write-Host "VM '$env:COMPUTERNAME' registered with Azure Arc successfully." -ForegroundColor Green | Out-Null '@ - + # Copy the script to the node $ScriptPath = "C:\Temp\ArcInitScript.ps1" Invoke-Command -VMName $nodeName -Credential $SetupCredentials -ScriptBlock { @@ -447,6 +447,7 @@ Write-Host "VM '$env:COMPUTERNAME' registered with Azure Arc successfully." -For } -ArgumentList $ArcInitScript, $ScriptPath -ErrorAction Stop -WarningAction SilentlyContinue -Verbose:$false | Out-Null # Run the script locally on the node + Start-SleepWithProgress -Seconds 20 -Activity "Waiting for Parameters" -Status "Waiting for Parameters" Invoke-Command -VMName $nodeName -Credential $SetupCredentials -ScriptBlock { param($ScriptPath, $SubscriptionID, $ResourceGroupName, $TenantID, $Cloud, $Location, $ARMToken, $AccountId) $ErrorActionPreference = 'Stop' @@ -459,7 +460,7 @@ Write-Host "VM '$env:COMPUTERNAME' registered with Azure Arc successfully." -For # Execute the script locally & $ScriptPath -SubscriptionID $SubscriptionID -ResourceGroupName $ResourceGroupName -TenantID $TenantID -Cloud $Cloud -Location $Location -ARMToken $ARMToken -AccountId $AccountId | Out-Null - } -ArgumentList $ScriptPath, $SubscriptionID, $resourceGroup, $TenantID, $Cloud, $Location, $ARMToken, $AccountId -ErrorAction Stop -WarningAction SilentlyContinue -Verbose:$false | Out-Null + } -ArgumentList $ScriptPath, $SubscriptionID, $ResourceGroupName, $TenantID, $Cloud, $Location, $ARMToken, $AccountId -ErrorAction Stop -WarningAction SilentlyContinue -Verbose:$false | Out-Null # Write-Message "VM '$nodeName' registered successfully with Azure Arc." -Type "Success" } catch {