Skip to content

Commit 2422bae

Browse files
Move StackHCI to release-2023-03-07 (#21123)
1 parent fa3e3ef commit 2422bae

File tree

65 files changed

+298
-208
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+298
-208
lines changed

src/StackHCI/Az.StackHCI.psd1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44
# Generated by: Microsoft Corporation
55
#
6-
# Generated on: 2/27/2023
6+
# Generated on: 3/6/2023
77
#
88

99
@{

src/StackHCI/StackHCI.sln

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@ Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio Version 17
44
VisualStudioVersion = 17.0.31903.59
55
MinimumVisualStudioVersion = 10.0.40219.1
6-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Accounts", "..\Accounts\Accounts\Accounts.csproj", "{39174213-6C80-4987-AB0C-43CAA3669F3F}"
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Accounts", "..\Accounts\Accounts\Accounts.csproj", "{6D183BC1-503C-4357-9CFE-E6D8C0D1091B}"
77
EndProject
8-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AssemblyLoading", "..\Accounts\AssemblyLoading\AssemblyLoading.csproj", "{F095DE48-C362-43CA-BDDD-A119920A9E7D}"
8+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AssemblyLoading", "..\Accounts\AssemblyLoading\AssemblyLoading.csproj", "{8C4ECCBD-F72F-45E5-9A70-FB975D51DD65}"
99
EndProject
10-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Authentication", "..\Accounts\Authentication\Authentication.csproj", "{F52158AF-C78E-4765-8721-2C9E6778B323}"
10+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Authentication", "..\Accounts\Authentication\Authentication.csproj", "{2D65ADE5-8256-40F0-8C61-80A3A7B1DD06}"
1111
EndProject
12-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Authentication.ResourceManager", "..\Accounts\Authentication.ResourceManager\Authentication.ResourceManager.csproj", "{01D7BE19-D97F-4730-B5D2-4B410BBD3CD2}"
12+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Authentication.ResourceManager", "..\Accounts\Authentication.ResourceManager\Authentication.ResourceManager.csproj", "{C6DA5CD7-9FEB-4150-A3FD-BC7B6621196E}"
1313
EndProject
14-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AuthenticationAssemblyLoadContext", "..\Accounts\AuthenticationAssemblyLoadContext\AuthenticationAssemblyLoadContext.csproj", "{81A759B1-754A-4C82-97A2-439646980C02}"
14+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AuthenticationAssemblyLoadContext", "..\Accounts\AuthenticationAssemblyLoadContext\AuthenticationAssemblyLoadContext.csproj", "{2398CFBE-7C62-4CEF-BDA9-071EB9E3AEAC}"
1515
EndProject
16-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Authenticators", "..\Accounts\Authenticators\Authenticators.csproj", "{435F721E-3CCE-493A-8430-BC1AEA382139}"
16+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Authenticators", "..\Accounts\Authenticators\Authenticators.csproj", "{D55AD32F-4CE5-44B0-8D51-865C832CE0EC}"
1717
EndProject
18-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Az.StackHCI", "Az.StackHCI.csproj", "{DAC22DDC-D376-4A68-B6E7-2101556F08ED}"
18+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Az.StackHCI", "Az.StackHCI.csproj", "{3FF7A9CD-CD48-421B-838C-A2EDAEE4E9A7}"
1919
EndProject
2020
Global
2121
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -26,33 +26,33 @@ Global
2626
HideSolutionNode = FALSE
2727
EndGlobalSection
2828
GlobalSection(ProjectConfigurationPlatforms) = postSolution
29-
{39174213-6C80-4987-AB0C-43CAA3669F3F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
30-
{39174213-6C80-4987-AB0C-43CAA3669F3F}.Debug|Any CPU.Build.0 = Debug|Any CPU
31-
{39174213-6C80-4987-AB0C-43CAA3669F3F}.Release|Any CPU.ActiveCfg = Release|Any CPU
32-
{39174213-6C80-4987-AB0C-43CAA3669F3F}.Release|Any CPU.Build.0 = Release|Any CPU
33-
{F095DE48-C362-43CA-BDDD-A119920A9E7D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
34-
{F095DE48-C362-43CA-BDDD-A119920A9E7D}.Debug|Any CPU.Build.0 = Debug|Any CPU
35-
{F095DE48-C362-43CA-BDDD-A119920A9E7D}.Release|Any CPU.ActiveCfg = Release|Any CPU
36-
{F095DE48-C362-43CA-BDDD-A119920A9E7D}.Release|Any CPU.Build.0 = Release|Any CPU
37-
{F52158AF-C78E-4765-8721-2C9E6778B323}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
38-
{F52158AF-C78E-4765-8721-2C9E6778B323}.Debug|Any CPU.Build.0 = Debug|Any CPU
39-
{F52158AF-C78E-4765-8721-2C9E6778B323}.Release|Any CPU.ActiveCfg = Release|Any CPU
40-
{F52158AF-C78E-4765-8721-2C9E6778B323}.Release|Any CPU.Build.0 = Release|Any CPU
41-
{01D7BE19-D97F-4730-B5D2-4B410BBD3CD2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
42-
{01D7BE19-D97F-4730-B5D2-4B410BBD3CD2}.Debug|Any CPU.Build.0 = Debug|Any CPU
43-
{01D7BE19-D97F-4730-B5D2-4B410BBD3CD2}.Release|Any CPU.ActiveCfg = Release|Any CPU
44-
{01D7BE19-D97F-4730-B5D2-4B410BBD3CD2}.Release|Any CPU.Build.0 = Release|Any CPU
45-
{81A759B1-754A-4C82-97A2-439646980C02}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
46-
{81A759B1-754A-4C82-97A2-439646980C02}.Debug|Any CPU.Build.0 = Debug|Any CPU
47-
{81A759B1-754A-4C82-97A2-439646980C02}.Release|Any CPU.ActiveCfg = Release|Any CPU
48-
{81A759B1-754A-4C82-97A2-439646980C02}.Release|Any CPU.Build.0 = Release|Any CPU
49-
{435F721E-3CCE-493A-8430-BC1AEA382139}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
50-
{435F721E-3CCE-493A-8430-BC1AEA382139}.Debug|Any CPU.Build.0 = Debug|Any CPU
51-
{435F721E-3CCE-493A-8430-BC1AEA382139}.Release|Any CPU.ActiveCfg = Release|Any CPU
52-
{435F721E-3CCE-493A-8430-BC1AEA382139}.Release|Any CPU.Build.0 = Release|Any CPU
53-
{DAC22DDC-D376-4A68-B6E7-2101556F08ED}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
54-
{DAC22DDC-D376-4A68-B6E7-2101556F08ED}.Debug|Any CPU.Build.0 = Debug|Any CPU
55-
{DAC22DDC-D376-4A68-B6E7-2101556F08ED}.Release|Any CPU.ActiveCfg = Release|Any CPU
56-
{DAC22DDC-D376-4A68-B6E7-2101556F08ED}.Release|Any CPU.Build.0 = Release|Any CPU
29+
{6D183BC1-503C-4357-9CFE-E6D8C0D1091B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
30+
{6D183BC1-503C-4357-9CFE-E6D8C0D1091B}.Debug|Any CPU.Build.0 = Debug|Any CPU
31+
{6D183BC1-503C-4357-9CFE-E6D8C0D1091B}.Release|Any CPU.ActiveCfg = Release|Any CPU
32+
{6D183BC1-503C-4357-9CFE-E6D8C0D1091B}.Release|Any CPU.Build.0 = Release|Any CPU
33+
{8C4ECCBD-F72F-45E5-9A70-FB975D51DD65}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
34+
{8C4ECCBD-F72F-45E5-9A70-FB975D51DD65}.Debug|Any CPU.Build.0 = Debug|Any CPU
35+
{8C4ECCBD-F72F-45E5-9A70-FB975D51DD65}.Release|Any CPU.ActiveCfg = Release|Any CPU
36+
{8C4ECCBD-F72F-45E5-9A70-FB975D51DD65}.Release|Any CPU.Build.0 = Release|Any CPU
37+
{2D65ADE5-8256-40F0-8C61-80A3A7B1DD06}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
38+
{2D65ADE5-8256-40F0-8C61-80A3A7B1DD06}.Debug|Any CPU.Build.0 = Debug|Any CPU
39+
{2D65ADE5-8256-40F0-8C61-80A3A7B1DD06}.Release|Any CPU.ActiveCfg = Release|Any CPU
40+
{2D65ADE5-8256-40F0-8C61-80A3A7B1DD06}.Release|Any CPU.Build.0 = Release|Any CPU
41+
{C6DA5CD7-9FEB-4150-A3FD-BC7B6621196E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
42+
{C6DA5CD7-9FEB-4150-A3FD-BC7B6621196E}.Debug|Any CPU.Build.0 = Debug|Any CPU
43+
{C6DA5CD7-9FEB-4150-A3FD-BC7B6621196E}.Release|Any CPU.ActiveCfg = Release|Any CPU
44+
{C6DA5CD7-9FEB-4150-A3FD-BC7B6621196E}.Release|Any CPU.Build.0 = Release|Any CPU
45+
{2398CFBE-7C62-4CEF-BDA9-071EB9E3AEAC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
46+
{2398CFBE-7C62-4CEF-BDA9-071EB9E3AEAC}.Debug|Any CPU.Build.0 = Debug|Any CPU
47+
{2398CFBE-7C62-4CEF-BDA9-071EB9E3AEAC}.Release|Any CPU.ActiveCfg = Release|Any CPU
48+
{2398CFBE-7C62-4CEF-BDA9-071EB9E3AEAC}.Release|Any CPU.Build.0 = Release|Any CPU
49+
{D55AD32F-4CE5-44B0-8D51-865C832CE0EC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
50+
{D55AD32F-4CE5-44B0-8D51-865C832CE0EC}.Debug|Any CPU.Build.0 = Debug|Any CPU
51+
{D55AD32F-4CE5-44B0-8D51-865C832CE0EC}.Release|Any CPU.ActiveCfg = Release|Any CPU
52+
{D55AD32F-4CE5-44B0-8D51-865C832CE0EC}.Release|Any CPU.Build.0 = Release|Any CPU
53+
{3FF7A9CD-CD48-421B-838C-A2EDAEE4E9A7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
54+
{3FF7A9CD-CD48-421B-838C-A2EDAEE4E9A7}.Debug|Any CPU.Build.0 = Debug|Any CPU
55+
{3FF7A9CD-CD48-421B-838C-A2EDAEE4E9A7}.Release|Any CPU.ActiveCfg = Release|Any CPU
56+
{3FF7A9CD-CD48-421B-838C-A2EDAEE4E9A7}.Release|Any CPU.Build.0 = Release|Any CPU
5757
EndGlobalSection
5858
EndGlobal

src/StackHCI/build-module.ps1

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,10 @@ $null = New-Item -ItemType Directory -Force -Path $examplesFolder
123123

124124
Write-Host -ForegroundColor Green 'Creating cmdlets for specified models...'
125125
$modelCmdlets = @()
126+
$modelCmdletFolder = Join-Path (Join-Path $PSScriptRoot './custom') 'autogen-model-cmdlets'
127+
if (Test-Path $modelCmdletFolder) {
128+
$null = Remove-Item -Force -Recurse -Path $modelCmdletFolder
129+
}
126130
if ($modelCmdlets.Count -gt 0) {
127131
. (Join-Path $PSScriptRoot 'create-model-cmdlets.ps1')
128132
CreateModelCmdlet($modelCmdlets)

src/StackHCI/create-model-cmdlets.ps1

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,13 @@ function CreateModelCmdlet {
2323
}
2424

2525
$ModelCsPath = Join-Path (Join-Path $PSScriptRoot 'generated\api') 'Models'
26-
$ModuleName = 'StackHCI'
2726
$OutputDir = Join-Path $PSScriptRoot 'custom\autogen-model-cmdlets'
2827
$null = New-Item -ItemType Directory -Force -Path $OutputDir
28+
if (''.length -gt 0) {
29+
$ModuleName = ''
30+
} else {
31+
$ModuleName = 'Az.StackHCI'
32+
}
2933

3034
$CsFiles = Get-ChildItem -Path $ModelCsPath -Recurse -Filter *.cs
3135
$Content = ''
@@ -64,10 +68,10 @@ function CreateModelCmdlet {
6468
$ObjectType = $Model
6569
$ObjectTypeWithNamespace = "${Namespace}.${ObjectType}"
6670
# remove duplicated module name
67-
if ($ObjectType.StartsWith($ModuleName)) {
71+
if ($ObjectType.StartsWith('StackHCI')) {
6872
$ModulePrefix = ''
6973
} else {
70-
$ModulePrefix = $ModuleName
74+
$ModulePrefix = 'StackHCI'
7175
}
7276
$OutputPath = Join-Path -ChildPath "New-Az${ModulePrefix}${ObjectType}Object.ps1" -Path $OutputDir
7377

@@ -158,7 +162,7 @@ Create an in-memory object for ${ObjectType}.
158162
.Outputs
159163
${ObjectTypeWithNamespace}
160164
.Link
161-
https://learn.microsoft.com/powershell/module/az.${ModuleName}/new-Az${ModulePrefix}${ObjectType}Object
165+
https://learn.microsoft.com/powershell/module/${ModuleName}/new-Az${ModulePrefix}${ObjectType}Object
162166
#>
163167
function New-Az${ModulePrefix}${ObjectType}Object {
164168
[OutputType('${ObjectTypeWithNamespace}')]

src/StackHCI/custom/stackhci.ps1

Lines changed: 69 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ $ArcIntegrationNotAvailableForCloudError = "Azure Arc for Server integration is
4141
$ArcNeedsToBeEnabledError = "Azure Arc for servers integration can't be disabled. Skip the parameter '-EnableAzureArcServer' or Specify '-EnableAzureArcServer:`$true' in Register-AzStackHCI Cmdlet to register."
4242
$ArcAADAppCreationMessage= "Creating AAD application for onboarding ARC"
4343
$FetchingRegistrationState = "Checking whether the cluster is already registered"
44+
$CheckingDependentModules = "Checking whether the required modules are installed"
4445
$ValidatingParametersFetchClusterName = "Validating cmdlet parameters"
4546
$ValidatingParametersRegisteredInfo = "Validating the parameters and checking registration information"
4647
$RegisterProgressActivityName = "Registering Azure Stack HCI with Azure..."
@@ -77,6 +78,7 @@ $VerifyingArcMessage = "Verifying Azure Arc for Servers registration"
7778
$WaitingUnregisterMessage = "Disabling Azure Arc integration on every clustered node"
7879
$CleanArcMessage = "Cleaning up Azure Arc integration"
7980

81+
$MissingDependentModulesError = "Can't find PowerShell module(s): {0}. Please install the missing module(s) using 'Install-Module -Name <Module_Name>' and try again."
8082
$ArcAlreadyEnabledInADifferentResourceError = "Below mentioned cluster node(s) are already Arc enabled with a different ARM Resource Id:`n{0}`nDisconnect Arc agent on these nodes and run Register-AzStackHCI again."
8183

8284
$ArcAgentRolesInsufficientPreviligeMessage = "Failed to assign required roles for Azure Arc integration. Your Azure AD account must be an Owner or User Access Administrator in the subscription to enable Azure Arc integration."
@@ -242,8 +244,8 @@ $ArcSettingsDisableInProgressState = "DisableInProgress"
242244
$ClusterAgentServiceName = "HciClusterAgentSvc"
243245
$ClusterAgentGroupName = "Cloud Management"
244246

245-
$AzAccountsModuleVersion="2.10.2"
246-
$AzResourcesModuleVersion="6.2.0"
247+
$AzAccountsModuleMinVersion="2.11.2"
248+
$AzResourcesModuleMinVersion="6.2.0"
247249

248250
Function Write-Log {
249251
[Microsoft.Azure.PowerShell.Cmdlets.StackHCI.DoNotExportAttribute()]
@@ -932,33 +934,65 @@ param(
932934
return "/Subscriptions/" + $SubscriptionId + "/resourceGroups/" + $ResourceGroupName + "/providers/Microsoft.AzureStackHCI/clusters/" + $ResourceName
933935
}
934936

935-
function Install-Dependent-Module{
936-
param(
937-
[string] $ModuleName,
938-
[string] $ModuleVersion
937+
function Import-DependentModule
938+
{
939+
param (
940+
[string] $ModuleName,
941+
[string] $MinVersion
939942
)
940-
try
943+
$module = Get-Module -Name $ModuleName
944+
if ((-not $module) -or ($module.Version -lt [System.Version]$MinVersion))
941945
{
942-
Import-Module -Name $ModuleName -RequiredVersion $ModuleVersion -ErrorAction Stop
943-
Write-VerboseLog ("Found required Module: {0} version: {1}" -f $ModuleName,$ModuleVersion)
944-
}
945-
catch
946-
{
947-
try
946+
Write-VerboseLog "Required module $ModuleName (minimum version: $MinVersion) is not imported"
947+
try
948948
{
949-
Import-PackageProvider -Name Nuget -MinimumVersion "2.8.5.201" -ErrorAction Stop
949+
# Adding this statement to clear all the versions that exist in the current PS session
950+
Remove-Module -Name $ModuleName -ErrorAction Ignore
951+
952+
Import-Module -Name $ModuleName -MinimumVersion $MinVersion
950953
}
951954
catch
952955
{
953-
Install-PackageProvider NuGet -Force | Out-Null
956+
Write-WarnLog "$_.Exception"
957+
Write-VerboseLog "Required module $ModuleName (minimum version: $MinVersion) is missing"
958+
throw ("$ModuleName (minimum version: $MinVersion)")
954959
}
960+
}
961+
}
955962

956-
Write-VerboseLog ("Installing Module: {0} version: {1}" -f $ModuleName,$ModuleVersion)
963+
function Check-DependentModules
964+
{
965+
param()
957966

958-
Install-Module -Name $ModuleName -RequiredVersion $ModuleVersion -Force -AllowClobber -Repository 'PSGallery'
959-
Import-Module -Name $ModuleName -RequiredVersion $ModuleVersion
960-
961-
Write-VerboseLog ("Successfully imported Module: {0} version: {1}" -f $ModuleName,$ModuleVersion)
967+
$missingDependentModules = [System.Collections.ArrayList]::new()
968+
969+
# Checking if Az.Accounts is imported
970+
try
971+
{
972+
Write-VerboseLog "Importing dependent module Az.Accounts"
973+
Import-DependentModule -ModuleName "Az.Accounts" -MinVersion $AzAccountsModuleMinVersion
974+
}
975+
catch
976+
{
977+
$missingDependentModules.Add($_.Exception.Message) | Out-Null
978+
}
979+
980+
# Checking if Az.Resources is imported
981+
try
982+
{
983+
Write-VerboseLog "Importing dependent module Az.Resources"
984+
Import-DependentModule -ModuleName "Az.Resources" -MinVersion $AzResourcesModuleMinVersion
985+
}
986+
catch
987+
{
988+
$missingDependentModules.Add($_.Exception.Message) | Out-Null
989+
}
990+
991+
if($missingDependentModules.Length -gt 0)
992+
{
993+
$missingDependentModules = $missingDependentModules -join ", "
994+
$MissingDependentModulesExceptionMessage = $MissingDependentModulesError -f $missingDependentModules
995+
throw $MissingDependentModulesExceptionMessage
962996
}
963997
}
964998

@@ -977,9 +1011,7 @@ param(
9771011
)
9781012

9791013
Write-Progress -Id $MainProgressBarId -activity $ProgressActivityName -status $InstallAzResourcesMessage -percentcomplete 10
980-
981-
Install-Dependent-Module -ModuleName "Az.Accounts" -ModuleVersion $AzAccountsModuleVersion
982-
Install-Dependent-Module -ModuleName "Az.Resources" -ModuleVersion $AzResourcesModuleVersion
1014+
9831015
Write-Progress -Id $MainProgressBarId -activity $ProgressActivityName -status $LoggingInToAzureMessage -percentcomplete 30
9841016

9851017
if($EnvironmentName -eq $AzurePPE)
@@ -2438,15 +2470,6 @@ param(
24382470
$registrationOutput = New-Object -TypeName PSObject
24392471
$operationStatus = [OperationStatus]::Unused
24402472

2441-
try
2442-
{
2443-
Import-PackageProvider -Name Nuget -MinimumVersion "2.8.5.201" -ErrorAction Stop
2444-
}
2445-
catch
2446-
{
2447-
Install-PackageProvider NuGet -Force | Out-Null
2448-
}
2449-
24502473
Show-LatestModuleVersion
24512474

24522475
if([string]::IsNullOrEmpty($ComputerName))
@@ -2459,7 +2482,10 @@ param(
24592482
$IsManagementNode = $True
24602483
}
24612484

2462-
Write-Progress -Id $MainProgressBarId -activity $RegisterProgressActivityName -status $FetchingRegistrationState -percentcomplete 1
2485+
Write-Progress -Id $MainProgressBarId -activity $RegisterProgressActivityName -status $CheckingDependentModules -percentcomplete 1
2486+
Check-DependentModules
2487+
2488+
Write-Progress -Id $MainProgressBarId -activity $RegisterProgressActivityName -status $FetchingRegistrationState -percentcomplete 2
24632489
if($IsManagementNode)
24642490
{
24652491
Write-VerboseLog ("Connecting via Management Node")
@@ -3546,8 +3572,10 @@ param(
35463572
Write-VerboseLog ("Overriding RP API version for MC cloud to 2022-09-01")
35473573
$RPAPIVersion = "2022-09-01"
35483574
}
3549-
3550-
Write-Progress -Id $MainProgressBarId -activity $UnregisterProgressActivityName -status $FetchingRegistrationState -percentcomplete 1
3575+
Write-Progress -Id $MainProgressBarId -activity $UnregisterProgressActivityName -status $CheckingDependentModules -percentcomplete 1
3576+
Check-DependentModules
3577+
3578+
Write-Progress -Id $MainProgressBarId -activity $UnregisterProgressActivityName -status $FetchingRegistrationState -percentcomplete 2
35513579
Write-VerboseLog ($UnregisterProgressActivityName)
35523580
$msg = Print-FunctionParameters -Message "Unregister-AzStackHCI" -Parameters $PSBoundParameters
35533581
Write-NodeEventLog -Message $msg -EventID 9009 -IsManagementNode $IsManagementNode -credentials $Credential -ComputerName $ComputerName
@@ -4167,14 +4195,18 @@ param(
41674195
{
41684196
$isManagementNode = $true
41694197
}
4170-
4198+
41714199
# To be removed after ARM rollout to MC cloud is complete
41724200
if ( $EnvironmentName -eq $AzureChinaCloud)
41734201
{
41744202
Write-VerboseLog ("Overriding RP API version for MC cloud to 2022-09-01")
41754203
$RPAPIVersion = "2022-09-01"
41764204
}
4177-
4205+
4206+
Write-Progress -Id $MainProgressBarId -Activity $SetProgressActivityName -Status $CheckingDependentModules -PercentComplete 2
4207+
Check-DependentModules
4208+
4209+
41784210
Write-Progress -Id $MainProgressBarId -Activity $SetProgressActivityName -Status $SetProgressStatusGathering -PercentComplete 5
41794211

41804212
if($PSBoundParameters.ContainsKey('ResourceId') -eq $false)
@@ -4283,11 +4315,6 @@ param(
42834315

42844316
$TenantId = Azure-Login @azureLoginParameters
42854317
}
4286-
else
4287-
{
4288-
Install-Dependent-Module -ModuleName "Az.Accounts" -ModuleVersion $AzAccountsModuleVersion
4289-
Install-Dependent-Module -ModuleName "Az.Resources" -ModuleVersion $AzResourcesModuleVersion
4290-
}
42914318

42924319
$armResource = Get-AzResource -ResourceId $armResourceId -ExpandProperties -ApiVersion $RPAPIVersion -ErrorAction Stop
42934320

src/StackHCI/exports/Add-AzStackHCIVMAttestation.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ begin {
7171
$parameterSet = $PSCmdlet.ParameterSetName
7272

7373
if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
74-
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString()
74+
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString()
7575
}
7676
$preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
7777
if ($preTelemetryId -eq '') {

src/StackHCI/exports/Disable-AzStackHCIAttestation.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ begin {
6767
$parameterSet = $PSCmdlet.ParameterSetName
6868

6969
if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
70-
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString()
70+
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString()
7171
}
7272
$preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
7373
if ($preTelemetryId -eq '') {

0 commit comments

Comments
 (0)