Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions src/StackHCI/StackHCI.Autorest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
This directory contains the PowerShell module for the StackHci service.

---
## Status
[![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/)

## Info
- Modifiable: yes
- Generated: all
Expand Down
35 changes: 10 additions & 25 deletions src/StackHCI/StackHCI.Autorest/custom/stackhci.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4723,7 +4723,6 @@ param(
$nodeSessionParams = @{}
$subscriptionId = [string]::Empty
$armResourceId = [string]::Empty
$armResource = $null

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

Expand Down Expand Up @@ -4845,50 +4844,36 @@ param(
$TenantId = Azure-Login @azureLoginParameters
}

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

$properties = [PSCustomObject]@{
desiredProperties = $armResource.Properties.desiredProperties
aadClientId = $armResource.Properties.aadClientId
aadTenantId = $armResource.Properties.aadTenantId
aadServicePrincipalObjectId = $armResource.Properties.aadServicePrincipalObjectId
aadApplicationObjectId = $armResource.Properties.aadApplicationObjectId
}

if ($properties.desiredProperties -eq $null)
{
#
# Create desiredProperties object with default values
#
$desiredProperties = New-Object -TypeName PSObject
$desiredProperties | Add-Member -MemberType NoteProperty -Name 'windowsServerSubscription' -Value 'Disabled'
$desiredProperties | Add-Member -MemberType NoteProperty -Name 'diagnosticLevel' -Value 'Basic'

$properties | Add-Member -MemberType NoteProperty -Name 'desiredProperties' -Value $desiredProperties
desiredProperties = New-Object -TypeName PSObject
}

if ($PSBoundParameters.ContainsKey('EnableWSSubscription'))
{
$windowsServerSubscriptionValue = $Null

if ($EnableWSSubscription -eq $true)
{
$properties.desiredProperties.windowsServerSubscription = 'Enabled';
$windowsServerSubscriptionValue = 'Enabled';

$successMessage.Append($SetAzResourceSuccessWSSE) | Out-Null;
}
else
{
$properties.desiredProperties.windowsServerSubscription = 'Disabled';
$windowsServerSubscriptionValue = 'Disabled';

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

$properties.desiredProperties | Add-Member -MemberType NoteProperty -Name 'windowsServerSubscription' -Value $windowsServerSubscriptionValue

$doSetResource = $true
$needShouldContinue = $true
}

if ($PSBoundParameters.ContainsKey('DiagnosticLevel'))
{
$properties.desiredProperties.diagnosticLevel = $DiagnosticLevel.ToString()
$properties.desiredProperties | Add-Member -MemberType NoteProperty -Name 'diagnosticLevel' -Value $($DiagnosticLevel.ToString())

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

$setAzResourceParameters = @{
'ResourceId' = $armResource.Id;
'ResourceId' = $armResourceId;
'Properties' = $properties;
'ApiVersion' = $RPAPIVersion
}

$localResult = Set-AzResource @setAzResourceParameters -Confirm:$false -Force -ErrorAction Stop
$localResult = Set-AzResource @setAzResourceParameters -UsePatchSemantics -Confirm:$false -Force -ErrorAction Stop

if ($PSBoundParameters.ContainsKey('EnableWSSubscription') -and ($EnableWSSubscription -eq $false))
{
Expand Down
2 changes: 1 addition & 1 deletion src/StackHCI/StackHCI/Az.StackHCI.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
# Generated by: Microsoft Corporation
#
# Generated on: 2/19/2024
# Generated on: 2/21/2024
#

@{
Expand Down