Skip to content

Commit 6c060a2

Browse files
Move StackHCI to main (#24184)
1 parent e0ceef9 commit 6c060a2

File tree

3 files changed

+11
-29
lines changed

3 files changed

+11
-29
lines changed

src/StackHCI/StackHCI.Autorest/README.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
This directory contains the PowerShell module for the StackHci service.
44

55
---
6-
## Status
7-
[![Az.StackHCI](https://img.shields.io/powershellgallery/v/Az.StackHCI.svg?style=flat-square&label=Az.StackHCI "Az.StackHCI")](https://www.powershellgallery.com/packages/Az.StackHCI/)
8-
96
## Info
107
- Modifiable: yes
118
- Generated: all

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

Lines changed: 10 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -4723,7 +4723,6 @@ param(
47234723
$nodeSessionParams = @{}
47244724
$subscriptionId = [string]::Empty
47254725
$armResourceId = [string]::Empty
4726-
$armResource = $null
47274726

47284727
$successMessage = New-Object -TypeName System.Text.StringBuilder
47294728

@@ -4845,50 +4844,36 @@ param(
48454844
$TenantId = Azure-Login @azureLoginParameters
48464845
}
48474846

4848-
$armResource = Get-AzResource -ResourceId $armResourceId -ExpandProperties -ApiVersion $RPAPIVersion -ErrorAction Stop
4849-
48504847
$properties = [PSCustomObject]@{
4851-
desiredProperties = $armResource.Properties.desiredProperties
4852-
aadClientId = $armResource.Properties.aadClientId
4853-
aadTenantId = $armResource.Properties.aadTenantId
4854-
aadServicePrincipalObjectId = $armResource.Properties.aadServicePrincipalObjectId
4855-
aadApplicationObjectId = $armResource.Properties.aadApplicationObjectId
4856-
}
4857-
4858-
if ($properties.desiredProperties -eq $null)
4859-
{
4860-
#
4861-
# Create desiredProperties object with default values
4862-
#
4863-
$desiredProperties = New-Object -TypeName PSObject
4864-
$desiredProperties | Add-Member -MemberType NoteProperty -Name 'windowsServerSubscription' -Value 'Disabled'
4865-
$desiredProperties | Add-Member -MemberType NoteProperty -Name 'diagnosticLevel' -Value 'Basic'
4866-
4867-
$properties | Add-Member -MemberType NoteProperty -Name 'desiredProperties' -Value $desiredProperties
4848+
desiredProperties = New-Object -TypeName PSObject
48684849
}
48694850

48704851
if ($PSBoundParameters.ContainsKey('EnableWSSubscription'))
48714852
{
4853+
$windowsServerSubscriptionValue = $Null
4854+
48724855
if ($EnableWSSubscription -eq $true)
48734856
{
4874-
$properties.desiredProperties.windowsServerSubscription = 'Enabled';
4857+
$windowsServerSubscriptionValue = 'Enabled';
48754858

48764859
$successMessage.Append($SetAzResourceSuccessWSSE) | Out-Null;
48774860
}
48784861
else
48794862
{
4880-
$properties.desiredProperties.windowsServerSubscription = 'Disabled';
4863+
$windowsServerSubscriptionValue = 'Disabled';
48814864

48824865
$successMessage.Append($SetAzResourceSuccessWSSD) | Out-Null;
48834866
}
48844867

4868+
$properties.desiredProperties | Add-Member -MemberType NoteProperty -Name 'windowsServerSubscription' -Value $windowsServerSubscriptionValue
4869+
48854870
$doSetResource = $true
48864871
$needShouldContinue = $true
48874872
}
48884873

48894874
if ($PSBoundParameters.ContainsKey('DiagnosticLevel'))
48904875
{
4891-
$properties.desiredProperties.diagnosticLevel = $DiagnosticLevel.ToString()
4876+
$properties.desiredProperties | Add-Member -MemberType NoteProperty -Name 'diagnosticLevel' -Value $($DiagnosticLevel.ToString())
48924877

48934878
if ($successMessage.Length -gt 0)
48944879
{
@@ -4917,12 +4902,12 @@ param(
49174902
Write-Progress -Id $MainProgressBarId -Activity $SetProgressActivityName -Status $SetProgressStatusUpdatingProps -PercentComplete 60
49184903

49194904
$setAzResourceParameters = @{
4920-
'ResourceId' = $armResource.Id;
4905+
'ResourceId' = $armResourceId;
49214906
'Properties' = $properties;
49224907
'ApiVersion' = $RPAPIVersion
49234908
}
49244909

4925-
$localResult = Set-AzResource @setAzResourceParameters -Confirm:$false -Force -ErrorAction Stop
4910+
$localResult = Set-AzResource @setAzResourceParameters -UsePatchSemantics -Confirm:$false -Force -ErrorAction Stop
49264911

49274912
if ($PSBoundParameters.ContainsKey('EnableWSSubscription') -and ($EnableWSSubscription -eq $false))
49284913
{

src/StackHCI/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/19/2024
6+
# Generated on: 2/21/2024
77
#
88

99
@{

0 commit comments

Comments
 (0)