Skip to content

Commit

Permalink
update 2025 for new ISO
Browse files Browse the repository at this point in the history
  • Loading branch information
schmittnieto committed Jan 3, 2025
1 parent e7856a5 commit d4eeeca
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions scripts/01Lab/02_Cluster.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 {
Expand All @@ -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'
Expand All @@ -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 {
Expand Down

0 comments on commit d4eeeca

Please sign in to comment.