@@ -162,7 +162,9 @@ Function Get-AzSInfraRole{
162162 $subscription , $headers = (Get-AzureStackAdminSubTokenHeader - TenantId $tenantId - AzureStackCredentials $azureStackCredentials - EnvironmentName $EnvironmentName )
163163 $URI = " ${ArmEndpoint} /subscriptions/${subscription} /resourceGroups/system.$region /providers/Microsoft.Fabric.Admin/fabricLocations/$region /InfraRoles?api-version=2016-05-01"
164164 $Roles = Invoke-RestMethod - Method GET - Uri $uri - ContentType ' application/json' - Headers $Headers
165- $roles.value
165+
166+ $roles.value | select name, properties
167+
166168
167169}
168170export-modulemember - function Get-AzSInfraRole
@@ -428,7 +430,9 @@ Function Close-AzSAlert{
428430 [ValidateNotNull ()]
429431 [System.Management.Automation.PSCredential ] $azureStackCredentials ,
430432
431- [Parameter (Mandatory = $true , HelpMessage = " The Azure Stack Administrator Environment Name" )]
433+
434+ [Parameter (Mandatory = $true , HelpMessage = " The Azure Stack Administrator Environment Name" , ParameterSetName = ' closealert' )]
435+
432436 [string ] $EnvironmentName ,
433437
434438 [Parameter (Mandatory = $false )]
@@ -449,7 +453,6 @@ Function Close-AzSAlert{
449453 $Alerts.properties.state = " Closed"
450454 $AlertUpdateBody = $Alerts | ConvertTo-Json
451455 $URI = " ${ArmEndpoint} /subscriptions/${subscription} /resourceGroups/system.$region /providers/Microsoft.InfrastructureInsights.Admin/regionHealths/$region /Alerts/${alertname} ?api-version=2016-05-01"
452- $URI
453456 $Close = Invoke-RestMethod - Method PUT - Uri $uri - ContentType ' application/json' - Headers $Headers - Body $AlertUpdateBody
454457 $CloseRun = $Close.value
455458 $closeRun
@@ -713,7 +716,9 @@ Function Restart-AzSInfraRoleInstance{
713716 [ValidateNotNull ()]
714717 [System.Management.Automation.PSCredential ] $azureStackCredentials ,
715718
716- [Parameter (Mandatory = $true , HelpMessage = " The Azure Stack Administrator Environment Name" )]
719+
720+ [Parameter (Mandatory = $true , HelpMessage = " The Azure Stack Administrator Environment Name" , ParameterSetName = ' RestartInfraRoleInstance' )]
721+
717722 [string ] $EnvironmentName ,
718723
719724 [string ] $region = ' local' ,
@@ -787,6 +792,83 @@ $IPPoolBodyJson =$IPPoolBody |ConvertTo-Json
787792}
788793export-modulemember - function Add-AzSIPPool
789794
795+
796+ <#
797+ . SYNOPSIS
798+ Enable Maintenance Mode
799+ #>
800+
801+ Function Disable-AzSScaleUnitNode {
802+ [CmdletBinding (DefaultParameterSetName = ' DisableAzSScaleUnitNode' )]
803+ Param (
804+
805+ [Parameter (Mandatory = $true , ParameterSetName = ' DisableAzSScaleUnitNode' )]
806+ [ValidateNotNullorEmpty ()]
807+ [String ] $TenantId ,
808+
809+ [Parameter (Mandatory = $true , ParameterSetName = ' DisableAzSScaleUnitNode' )]
810+ [ValidateNotNullorEmpty ()]
811+ [System.Management.Automation.PSCredential ] $azureStackCredentials ,
812+
813+ [Parameter (Mandatory = $true , HelpMessage = " The Azure Stack Administrator Environment Name" , ParameterSetName = ' DisableAzSScaleUnitNode' )]
814+ [string ] $EnvironmentName ,
815+
816+ [Parameter (ParameterSetName = ' DisableAzSScaleUnitNode' )]
817+ [string ] $region = ' local' ,
818+
819+ [Parameter (Mandatory = $true , ParameterSetName = ' DisableAzSScaleUnitNode' )]
820+ [string ] $Name
821+
822+ )
823+ $ARMEndpoint = GetARMEndpoint - EnvironmentName $EnvironmentName - ErrorAction Stop
824+
825+ $subscription , $headers = (Get-AzureStackAdminSubTokenHeader - TenantId $tenantId - AzureStackCredentials $azureStackCredentials - EnvironmentName $EnvironmentName )
826+ $URI = " ${ArmEndpoint} /subscriptions/${subscription} /resourceGroups/system.$region /providers/Microsoft.Fabric.Admin/fabricLocations/$region /scaleunitnodes/$name /StartMaintenanceMode?api-version=2016-05-01"
827+ $Drain = Invoke-RestMethod - Method Post - Uri $uri - ContentType ' application/json' - Headers $Headers
828+ $Drain
829+
830+ }
831+ export-modulemember - function Disable-AzSScaleUnitNode
832+
833+
834+ <#
835+ . SYNOPSIS
836+ Disable Maintenance Mode
837+ #>
838+
839+ Function Enable-AzSScaleUnitNode {
840+ [CmdletBinding (DefaultParameterSetName = ' EnableAzSScaleUnitNode' )]
841+ Param (
842+
843+ [Parameter (Mandatory = $true , ParameterSetName = ' EnableAzSScaleUnitNode' )]
844+ [ValidateNotNullorEmpty ()]
845+ [String ] $TenantId ,
846+
847+ [Parameter (Mandatory = $true , ParameterSetName = ' EnableAzSScaleUnitNode' )]
848+ [ValidateNotNullorEmpty ()]
849+ [System.Management.Automation.PSCredential ] $azureStackCredentials ,
850+
851+ [Parameter (Mandatory = $true , HelpMessage = " The Azure Stack Administrator Environment Name" , ParameterSetName = ' EnableAzSScaleUnitNode' )]
852+ [string ] $EnvironmentName ,
853+
854+ [Parameter (ParameterSetName = ' EnableAzSScaleUnitNode' )]
855+ [string ] $region = ' local' ,
856+
857+ [Parameter (Mandatory = $true , ParameterSetName = ' EnableAzSScaleUnitNode' )]
858+ [string ] $Name
859+
860+ )
861+ $ARMEndpoint = GetARMEndpoint - EnvironmentName $EnvironmentName - ErrorAction Stop
862+
863+ $subscription , $headers = (Get-AzureStackAdminSubTokenHeader - TenantId $tenantId - AzureStackCredentials $azureStackCredentials - EnvironmentName $EnvironmentName )
864+ $URI = " ${ArmEndpoint} /subscriptions/${subscription} /resourceGroups/system.$region /providers/Microsoft.Fabric.Admin/fabricLocations/$region /scaleunitnodes/$name /StopMaintenanceMode?api-version=2016-05-01"
865+ $Resume = Invoke-RestMethod - Method Post - Uri $uri - ContentType ' application/json' - Headers $Headers
866+ $Resume
867+
868+ }
869+ export-modulemember - function Enable-AzSScaleUnitNode
870+
871+
790872Function Set-AzSLocationInformation {
791873 Param (
792874 [Parameter (Mandatory = $true )]
0 commit comments