Skip to content

Commit b9f164a

Browse files
Migrate StackHCI from generation to main (Azure#25578)
* Move StackHCI to main * Update ChangeLog.md --------- Co-authored-by: Yabo Hu <[email protected]>
1 parent 39e37db commit b9f164a

31 files changed

+470
-81
lines changed

src/StackHCI/StackHCI.Autorest/build-module.ps1

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code
1313
# is regenerated.
1414
# ----------------------------------------------------------------------------------
15-
param([switch]$Isolated, [switch]$Run, [switch]$Test, [switch]$Docs, [switch]$Pack, [switch]$Code, [switch]$Release, [switch]$Debugger, [switch]$NoDocs)
15+
param([switch]$Isolated, [switch]$Run, [switch]$Test, [switch]$Docs, [switch]$Pack, [switch]$Code, [switch]$Release, [switch]$Debugger, [switch]$NoDocs, [Switch]$DisableAfterBuildTasks)
1616
$ErrorActionPreference = 'Stop'
1717

1818
if($PSEdition -ne 'Core') {
@@ -169,4 +169,14 @@ if (Test-Path (Join-Path $PSScriptRoot 'generate-portal-ux.ps1'))
169169
. (Join-Path $PSScriptRoot 'generate-portal-ux.ps1')
170170
}
171171

172+
if (-not $DisableAfterBuildTasks){
173+
$afterBuildTasksPath = Join-Path $PSScriptRoot ''
174+
$afterBuildTasksArgs = ConvertFrom-Json 'true' -AsHashtable
175+
if(Test-Path -Path $afterBuildTasksPath -PathType leaf){
176+
Write-Host -ForegroundColor Green 'Running after build tasks...'
177+
. $afterBuildTasksPath @afterBuildTasksArgs
178+
}
179+
}
180+
181+
172182
Write-Host -ForegroundColor Green '-------------Done-------------'

src/StackHCI/StackHCI.Autorest/custom/stackhci.ps1

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ $StartingArcAgentMessage = "Enabling Azure Arc integration on every clustered no
7676
$VerifyingArcMessage = "Verifying Azure Arc for Servers registration"
7777
$WaitingUnregisterMessage = "Disabling Azure Arc integration on every clustered node"
7878
$CleanArcMessage = "Cleaning up Azure Arc integration"
79-
$NonCloudDeploymentFor23H2DevicesErrorMessage = "Azure stack HCI version 23H2 and higher cannot be registered using this method. See details: https://learn.microsoft.com/en-us/azure-stack/hci/deploy/deploy-via-portal"
8079

8180
$MissingDependentModulesError = "Can't find PowerShell module(s): {0}. Please install the missing module(s) using 'Install-Module -Name <Module_Name>' and try again."
8281
$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."
@@ -2895,21 +2894,6 @@ param(
28952894
Write-VerboseLog ("Cloud Management supported: {0}" -f $isCloudManagementSupported)
28962895
Write-VerboseLog ("Cloud Management Infra supported: {0}" -f $isCloudManagementInfraSupported)
28972896
Write-VerboseLog ("Installing Mandatory extensions supported: {0}" -f $isDefaultExtensionSupported)
2898-
2899-
$allowFor23H2Devices = Verify-23H2VanillaRegistration -clusterNodeSession $clusterNodeSession
2900-
if(([Int]::Parse($osVersionInfo.BuildNumber) -ge $23H2BuildNumber) -and !($allowFor23H2Devices))
2901-
{
2902-
#error message
2903-
Write-ErrorLog -Message $NonCloudDeploymentFor23H2DevicesErrorMessage -Category OperationStopped
2904-
$resultValue = [OperationStatus]::Failed
2905-
$registrationOutput | Add-Member -MemberType NoteProperty -Name $OutputPropertyResult -Value [OperationStatus]::Failed -ErrorAction Continue
2906-
$NonCloudDeploymentFor23H2DevicesErrorCode = 9132
2907-
Set-WacOutputProperty -IsWAC $IsWAC -PropertyName $OutputPropertyWacResult -PropertyValue $resultValue.ToString() -Output $registrationOutput
2908-
Set-WacOutputProperty -IsWAC $IsWAC -PropertyName $OutputPropertyWacErrorCode -PropertyValue $NonCloudDeploymentFor23H2DevicesErrorCode -Output $registrationOutput
2909-
Write-Output $registrationOutput | Format-List
2910-
Write-NodeEventLog -Message $NonCloudDeploymentFor23H2DevicesErrorMessage -EventID 9132 -IsManagementNode $IsManagementNode -credentials $Credential -ComputerName $ComputerName -Level Error
2911-
throw
2912-
}
29132897

29142898
if(-Not ([string]::IsNullOrEmpty($RegContext.AzureResourceUri)))
29152899
{
@@ -3888,17 +3872,6 @@ Set-WacOutputProperty -IsWAC $IsWAC -PropertyName $OutputPropertyWacResult -Prop
38883872
}
38893873
}
38903874

3891-
function Verify-23H2VanillaRegistration {
3892-
[Microsoft.Azure.PowerShell.Cmdlets.StackHCI.DoNotExportAttribute()]
3893-
param(
3894-
[System.Management.Automation.Runspaces.PSSession] $clusterNodeSession
3895-
)
3896-
3897-
$detectRegKeyfor23H2 = { $lcmRegKey = Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\LCMAzureStackStampInformation" -Name "InitializationComplete" -ErrorAction SilentlyContinue; $lcmRegKey -ne $null }
3898-
$allowFor23H2Devices = Invoke-Command -Session $clusterNodeSession -ScriptBlock $detectRegKeyfor23H2
3899-
3900-
return $allowFor23H2Devices
3901-
}
39023875

39033876
function Set-ArcRoleforRPSpn {
39043877
[Microsoft.Azure.PowerShell.Cmdlets.StackHCI.DoNotExportAttribute()]

src/StackHCI/StackHCI/Az.StackHCI.psd1

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44
# Generated by: Microsoft Corporation
55
#
6-
# Generated on: 23/04/2024
6+
# Generated on: 7/17/2024
77
#
88

99
@{
@@ -51,19 +51,19 @@ DotNetFrameworkVersion = '4.7.2'
5151
# ProcessorArchitecture = ''
5252

5353
# Modules that must be imported into the global environment prior to importing this module
54-
RequiredModules = @(@{ModuleName = 'Az.Accounts'; ModuleVersion = '2.19.0'; })
54+
RequiredModules = @(@{ModuleName = 'Az.Accounts'; ModuleVersion = '3.0.2'; })
5555

5656
# Assemblies that must be loaded prior to importing this module
5757
RequiredAssemblies = 'StackHCI.Autorest/bin/Az.StackHCI.private.dll'
5858

5959
# Script files (.ps1) that are run in the caller's environment prior to importing this module.
60-
# ScriptsToProcess = @()
60+
ScriptsToProcess = @()
6161

6262
# Type files (.ps1xml) to be loaded when importing this module
63-
# TypesToProcess = @()
63+
TypesToProcess = @()
6464

6565
# Format files (.ps1xml) to be loaded when importing this module
66-
FormatsToProcess = 'StackHCI.Autorest\Az.StackHCI.format.ps1xml'
66+
FormatsToProcess = 'StackHCI.Autorest/Az.StackHCI.format.ps1xml'
6767

6868
# Modules to import as nested modules of the module specified in RootModule/ModuleToProcess
6969
NestedModules = @('StackHCI.Autorest/Az.StackHCI.psm1')
@@ -109,7 +109,7 @@ PrivateData = @{
109109
PSData = @{
110110

111111
# Tags applied to this module. These help with module discovery in online galleries.
112-
Tags = 'Azure','ResourceManager','ARM','PSModule','StackHci'
112+
Tags = 'Azure', 'ResourceManager', 'ARM', 'PSModule', 'StackHci'
113113

114114
# A URL to the license for this module.
115115
LicenseUri = 'https://aka.ms/azps-license'
@@ -134,7 +134,7 @@ PrivateData = @{
134134

135135
} # End of PSData hashtable
136136

137-
} # End of PrivateData hashtable
137+
} # End of PrivateData hashtable
138138

139139
# HelpInfo URI of this module
140140
# HelpInfoURI = ''

src/StackHCI/StackHCI/ChangeLog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
- Additional information about change #1
1919
-->
2020
## Upcoming Release
21+
* Allowed registration for 23H2 and above versions of the device
2122

2223
## Version 2.3.2
2324
* Introduced secrets detection feature to safeguard sensitive data.

src/StackHCI/StackHCI/help/Add-AzStackHCIVMAttestation.md

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,19 @@ Add-AzStackHCIVMAttestation configures guests for AzureStack HCI IMDS Attestatio
1414

1515
### VMName (Default)
1616
```
17-
Add-AzStackHCIVMAttestation [-VMName] <String[]> [-Force] [-WhatIf]
17+
Add-AzStackHCIVMAttestation [-VMName] <String[]> [-Force] [-ProgressAction <ActionPreference>] [-WhatIf]
1818
[-Confirm] [<CommonParameters>]
1919
```
2020

2121
### VMObject
2222
```
23-
Add-AzStackHCIVMAttestation [-Force] [-VM] <Object[]> [-WhatIf] [-Confirm]
23+
Add-AzStackHCIVMAttestation [-Force] [-VM] <Object[]> [-ProgressAction <ActionPreference>] [-WhatIf] [-Confirm]
2424
[<CommonParameters>]
2525
```
2626

2727
### AddAll
2828
```
29-
Add-AzStackHCIVMAttestation [-Force] [-AddAll] [-WhatIf] [-Confirm]
29+
Add-AzStackHCIVMAttestation [-Force] [-AddAll] [-ProgressAction <ActionPreference>] [-WhatIf] [-Confirm]
3030
[<CommonParameters>]
3131
```
3232

@@ -107,6 +107,21 @@ Accept pipeline input: False
107107
Accept wildcard characters: False
108108
```
109109
110+
### -ProgressAction
111+
{{ Fill ProgressAction Description }}
112+
113+
```yaml
114+
Type: System.Management.Automation.ActionPreference
115+
Parameter Sets: (All)
116+
Aliases: proga
117+
118+
Required: False
119+
Position: Named
120+
Default value: None
121+
Accept pipeline input: False
122+
Accept wildcard characters: False
123+
```
124+
110125
### -VM
111126
Specifies an array of VM objects from Get-VM.
112127

src/StackHCI/StackHCI/help/Disable-AzStackHCIAttestation.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Disable-AzStackHCIAttestation disables IMDS Attestation on the host
1414

1515
```
1616
Disable-AzStackHCIAttestation [[-ComputerName] <String>] [-Credential <PSCredential>] [-RemoveVM] [-Force]
17-
[-WhatIf] [-Confirm] [<CommonParameters>]
17+
[-ProgressAction <ActionPreference>] [-WhatIf] [-Confirm] [<CommonParameters>]
1818
```
1919

2020
## DESCRIPTION
@@ -83,6 +83,21 @@ Accept pipeline input: False
8383
Accept wildcard characters: False
8484
```
8585
86+
### -ProgressAction
87+
{{ Fill ProgressAction Description }}
88+
89+
```yaml
90+
Type: System.Management.Automation.ActionPreference
91+
Parameter Sets: (All)
92+
Aliases: proga
93+
94+
Required: False
95+
Position: Named
96+
Default value: None
97+
Accept pipeline input: False
98+
Accept wildcard characters: False
99+
```
100+
86101
### -RemoveVM
87102
Specifies the guests on each node should be removed from IMDS Attestation before disabling on cluster.
88103
Disable cannot continue before guests are removed.

src/StackHCI/StackHCI/help/Disable-AzStackHCIRemoteSupport.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Disables Remote Support.
1313
## SYNTAX
1414

1515
```
16-
Disable-AzStackHCIRemoteSupport [-WhatIf] [-Confirm] [<CommonParameters>]
16+
Disable-AzStackHCIRemoteSupport [-ProgressAction <ActionPreference>] [-WhatIf] [-Confirm] [<CommonParameters>]
1717
```
1818

1919
## DESCRIPTION
@@ -37,6 +37,21 @@ Disabling Remort support
3737

3838
## PARAMETERS
3939

40+
### -ProgressAction
41+
{{ Fill ProgressAction Description }}
42+
43+
```yaml
44+
Type: System.Management.Automation.ActionPreference
45+
Parameter Sets: (All)
46+
Aliases: proga
47+
48+
Required: False
49+
Position: Named
50+
Default value: None
51+
Accept pipeline input: False
52+
Accept wildcard characters: False
53+
```
54+
4055
### -Confirm
4156
Prompts you for confirmation before running the cmdlet.
4257

src/StackHCI/StackHCI/help/Enable-AzStackHCIAttestation.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Enable-AzStackHCIAttestation configures the host and enables specified guests fo
1414

1515
```
1616
Enable-AzStackHCIAttestation [[-ComputerName] <String>] [-Credential <PSCredential>] [-AddVM] [-Force]
17-
[-WhatIf] [-Confirm] [<CommonParameters>]
17+
[-ProgressAction <ActionPreference>] [-WhatIf] [-Confirm] [<CommonParameters>]
1818
```
1919

2020
## DESCRIPTION
@@ -99,6 +99,21 @@ Accept pipeline input: False
9999
Accept wildcard characters: False
100100
```
101101
102+
### -ProgressAction
103+
{{ Fill ProgressAction Description }}
104+
105+
```yaml
106+
Type: System.Management.Automation.ActionPreference
107+
Parameter Sets: (All)
108+
Aliases: proga
109+
110+
Required: False
111+
Position: Named
112+
Default value: None
113+
Accept pipeline input: False
114+
Accept wildcard characters: False
115+
```
116+
102117
### -Confirm
103118
Prompts you for confirmation before running the cmdlet.
104119

src/StackHCI/StackHCI/help/Enable-AzStackHCIRemoteSupport.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Enables Remote Support.
1414

1515
```
1616
Enable-AzStackHCIRemoteSupport [-AccessLevel] <String> [[-ExpireInMinutes] <Int32>] [[-SasCredential] <String>]
17-
[-AgreeToRemoteSupportConsent] [-WhatIf] [-Confirm] [<CommonParameters>]
17+
[-AgreeToRemoteSupportConsent] [-ProgressAction <ActionPreference>] [-WhatIf] [-Confirm] [<CommonParameters>]
1818
```
1919

2020
## DESCRIPTION
@@ -118,6 +118,21 @@ Accept pipeline input: False
118118
Accept wildcard characters: False
119119
```
120120
121+
### -ProgressAction
122+
{{ Fill ProgressAction Description }}
123+
124+
```yaml
125+
Type: System.Management.Automation.ActionPreference
126+
Parameter Sets: (All)
127+
Aliases: proga
128+
129+
Required: False
130+
Position: Named
131+
Default value: None
132+
Accept pipeline input: False
133+
Accept wildcard characters: False
134+
```
135+
121136
### -SasCredential
122137
Hybrid Connection SAS Credential.
123138

src/StackHCI/StackHCI/help/Get-AzStackHCILogsDirectory.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Returns Logs directory path on the current node.
1414

1515
```
1616
Get-AzStackHCILogsDirectory [[-Credential] <PSCredential>] [[-ComputerName] <String>]
17-
[-WhatIf] [-Confirm] [<CommonParameters>]
17+
[-ProgressAction <ActionPreference>] [-WhatIf] [-Confirm] [<CommonParameters>]
1818
```
1919

2020
## DESCRIPTION
@@ -66,6 +66,21 @@ Accept pipeline input: False
6666
Accept wildcard characters: False
6767
```
6868
69+
### -ProgressAction
70+
{{ Fill ProgressAction Description }}
71+
72+
```yaml
73+
Type: System.Management.Automation.ActionPreference
74+
Parameter Sets: (All)
75+
Aliases: proga
76+
77+
Required: False
78+
Position: Named
79+
Default value: None
80+
Accept pipeline input: False
81+
Accept wildcard characters: False
82+
```
83+
6984
### -Confirm
7085
Prompts you for confirmation before running the cmdlet.
7186

src/StackHCI/StackHCI/help/Get-AzStackHCIRemoteSupportAccess.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Gets Remote Support Access.
1313
## SYNTAX
1414

1515
```
16-
Get-AzStackHCIRemoteSupportAccess [-Cluster] [-IncludeExpired]
16+
Get-AzStackHCIRemoteSupportAccess [-Cluster] [-IncludeExpired] [-ProgressAction <ActionPreference>]
1717
[<CommonParameters>]
1818
```
1919

@@ -102,6 +102,21 @@ Accept pipeline input: False
102102
Accept wildcard characters: False
103103
```
104104
105+
### -ProgressAction
106+
{{ Fill ProgressAction Description }}
107+
108+
```yaml
109+
Type: System.Management.Automation.ActionPreference
110+
Parameter Sets: (All)
111+
Aliases: proga
112+
113+
Required: False
114+
Position: Named
115+
Default value: None
116+
Accept pipeline input: False
117+
Accept wildcard characters: False
118+
```
119+
105120
### CommonParameters
106121
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
107122

src/StackHCI/StackHCI/help/Get-AzStackHCIRemoteSupportSessionHistory.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Gets Remote Support Session History Details.
1414

1515
```
1616
Get-AzStackHCIRemoteSupportSessionHistory [[-SessionId] <String>] [-IncludeSessionTranscript]
17-
[[-FromDate] <DateTime>] [<CommonParameters>]
17+
[[-FromDate] <DateTime>] [-ProgressAction <ActionPreference>] [<CommonParameters>]
1818
```
1919

2020
## DESCRIPTION
@@ -72,6 +72,21 @@ Accept pipeline input: False
7272
Accept wildcard characters: False
7373
```
7474
75+
### -ProgressAction
76+
{{ Fill ProgressAction Description }}
77+
78+
```yaml
79+
Type: System.Management.Automation.ActionPreference
80+
Parameter Sets: (All)
81+
Aliases: proga
82+
83+
Required: False
84+
Position: Named
85+
Default value: None
86+
Accept pipeline input: False
87+
Accept wildcard characters: False
88+
```
89+
7590
### -SessionId
7691
Optional.
7792
Session Id to get details for a specific session.

0 commit comments

Comments
 (0)