@@ -389,7 +389,7 @@ function Start-AzsInfrastructureRoleInstance {
389389 [switch ] $Force
390390 )
391391
392- if ($Force.IsPresent -or $PSCmdlet.ShouldContinue (" Are you sure to start $Name ?" , " " )) {
392+ if ($Force.IsPresent -or $PSCmdlet.ShouldContinue (" Are you sure you want to start $Name ?" , " " )) {
393393 $resourceType = " Microsoft.Fabric.Admin/fabricLocations/infraRoleInstances"
394394
395395 Invoke-AzsInfrastructureAction - Name $Name - Action " poweron" - Location $Location - ResourceType $resourceType
@@ -415,7 +415,7 @@ function Stop-AzsInfrastructureRoleInstance {
415415 [switch ] $Force
416416 )
417417
418- if ($Force.IsPresent -or $PSCmdlet.ShouldContinue (" Are you sure to shut down $Name ?" , " " )) {
418+ if ($Force.IsPresent -or $PSCmdlet.ShouldContinue (" Are you sure you want to shut down $Name ?" , " " )) {
419419 $resourceType = " Microsoft.Fabric.Admin/fabricLocations/infraRoleInstances"
420420
421421 Invoke-AzsInfrastructureAction - Name $Name - Action " shutdown" - Location $Location - ResourceType $resourceType
@@ -441,7 +441,7 @@ function Restart-AzsInfrastructureRoleInstance {
441441 [switch ] $Force
442442 )
443443
444- if ($Force.IsPresent -or $PSCmdlet.ShouldContinue (" Are you sure to restart $Name ?" , " " )) {
444+ if ($Force.IsPresent -or $PSCmdlet.ShouldContinue (" Are you sure you want to restart $Name ?" , " " )) {
445445 $resourceType = " Microsoft.Fabric.Admin/fabricLocations/infraRoleInstances"
446446
447447 Invoke-AzsInfrastructureAction - Name $Name - Action " reboot" - Location $Location - ResourceType $resourceType
@@ -479,7 +479,7 @@ function Add-AzsIpPool {
479479 ResourceType = " Microsoft.Fabric.Admin/fabricLocations/IPPools"
480480 ResourceGroupName = " system.{0}" -f $Location
481481 ApiVersion = " 2016-05-01"
482- Properties = @ {
482+ Properties = @ {
483483 StartIpAddress = " $StartIPAddress "
484484 EndIpAddress = " $EndIPAddress "
485485 AddressPrefix = " $AddressPrefix "
@@ -509,7 +509,7 @@ function Disable-AzsScaleUnitNode {
509509 [switch ] $Force
510510 )
511511
512- if ($Force.IsPresent -or $PSCmdlet.ShouldContinue (" Are you sure to disable scale unit node $Name ?" , " " )) {
512+ if ($Force.IsPresent -or $PSCmdlet.ShouldContinue (" Are you sure you want to disable scale unit node $Name ?" , " " )) {
513513 $resourceType = " Microsoft.Fabric.Admin/fabricLocations/scaleunitnodes"
514514
515515 Invoke-AzsInfrastructureAction - Action " StartMaintenanceMode" - Name $Name - Location $Location - ResourceType $resourceType
@@ -537,7 +537,7 @@ function Enable-AzsScaleUnitNode {
537537 [switch ] $Force
538538 )
539539
540- if ($Force.IsPresent -or $PSCmdlet.ShouldContinue (" Are you sure to enable scale unit node $Name ?" , " " )) {
540+ if ($Force.IsPresent -or $PSCmdlet.ShouldContinue (" Are you sure you want to enable scale unit node $Name ?" , " " )) {
541541 $resourceType = " Microsoft.Fabric.Admin/fabricLocations/scaleunitnodes"
542542
543543 Invoke-AzsInfrastructureAction - Action " StopMaintenanceMode" - Name $Name - Location $Location - ResourceType $resourceType
@@ -546,6 +546,94 @@ function Enable-AzsScaleUnitNode {
546546
547547Export-ModuleMember - Function Enable-AzsScaleUnitNode
548548
549+ <#
550+ . SYNOPSIS
551+ Repairs a scale unit node by reimaging and readding a specific node
552+ #>
553+
554+ function Repair-AzsScaleUnitNode {
555+ [CmdletBinding (SupportsShouldProcess = $true )]
556+ Param (
557+ [Parameter (Mandatory = $false )]
558+ [string ] $Location ,
559+
560+ [Parameter (Mandatory = $true )]
561+ [ValidateNotNullorEmpty ()]
562+ [string ] $ScaleUnitNodeName ,
563+
564+ [Parameter (Mandatory = $true )]
565+ [ValidateNotNullorEmpty ()]
566+ [string ] $BMCIPv4Address ,
567+
568+ [switch ] $Force
569+ )
570+
571+ if ($Force.IsPresent -or $PSCmdlet.ShouldContinue (" Are you sure you want to repair scale unit node $ScaleUnitNodeName ?" , " " )) {
572+ $resourceType = " Microsoft.Fabric.Admin/fabricLocations/scaleunitnodes"
573+
574+ $parameters = @ {
575+ bmcIPv4Address = $BMCIPv4Address
576+ }
577+
578+ Invoke-AzsInfrastructureAction - Action " Repair" - Name $ScaleUnitNodeName - Location $Location - ResourceType $resourceType - Parameters $parameters
579+ }
580+ }
581+
582+ Export-ModuleMember - Function Repair-AzsScaleUnitNode
583+
584+ <#
585+ . SYNOPSIS
586+ Powers off a scale unit node
587+ #>
588+
589+ function Stop-AzsScaleUnitNode {
590+ [CmdletBinding (SupportsShouldProcess = $true )]
591+ Param (
592+ [Parameter (Mandatory = $false )]
593+ [string ] $Location ,
594+
595+ [Parameter (Mandatory = $true )]
596+ [ValidateNotNullorEmpty ()]
597+ [string ] $ScaleUnitNodeName ,
598+
599+ [switch ] $Force
600+ )
601+
602+ if ($Force.IsPresent -or $PSCmdlet.ShouldContinue (" Are you sure you want to stop scale unit node $ScaleUnitNodeName ?" , " " )) {
603+ $resourceType = " Microsoft.Fabric.Admin/fabricLocations/scaleunitnodes"
604+
605+ Invoke-AzsInfrastructureAction - Action " PowerOff" - Name $ScaleUnitNodeName - Location $Location - ResourceType $resourceType
606+ }
607+ }
608+
609+ Export-ModuleMember - Function Stop-AzsScaleUnitNode
610+
611+ <#
612+ . SYNOPSIS
613+ Powers on a scale unit node
614+ #>
615+
616+ function Start-AzsScaleUnitNode {
617+ [CmdletBinding (SupportsShouldProcess = $true )]
618+ Param (
619+ [Parameter (Mandatory = $false )]
620+ [string ] $Location ,
621+
622+ [Parameter (Mandatory = $true )]
623+ [ValidateNotNullorEmpty ()]
624+ [string ] $ScaleUnitNodeName ,
625+
626+ [switch ] $Force
627+ )
628+
629+ if ($Force.IsPresent -or $PSCmdlet.ShouldContinue (" Are you sure you want to start scale unit node $ScaleUnitNodeName ?" , " " )) {
630+ $resourceType = " Microsoft.Fabric.Admin/fabricLocations/scaleunitnodes"
631+
632+ Invoke-AzsInfrastructureAction - Action " PowerOn" - Name $ScaleUnitNodeName - Location $Location - ResourceType $resourceType
633+ }
634+ }
635+
636+ Export-ModuleMember - Function Start-AzsScaleUnitNode
549637
550638<#
551639 . SYNOPSIS
@@ -646,6 +734,85 @@ function Set-AzSLocationInformation {
646734 New-AzureRmResource @params - IsFullObject - Force
647735}
648736
737+ <#
738+ . SYNOPSIS
739+ Start Infrastructure Backup
740+ #>
741+ function Start-AzsBackup {
742+ [CmdletBinding (SupportsShouldProcess = $true )]
743+ Param (
744+ [Parameter (Mandatory = $false )]
745+ [string ] $Location
746+ )
747+
748+ $resourceType = " Microsoft.Backup.Admin/backupLocations"
749+ Invoke-AzsInfrastructureAction - Name $Location - Action " createbackup" - Location $Location - ResourceType $resourceType
750+ }
751+
752+ Export-ModuleMember - Function Start-AzsBackup
753+
754+ <#
755+ . SYNOPSIS
756+ Restore Infrastructure Backup
757+ #>
758+ function Restore-AzsBackup {
759+ [CmdletBinding (SupportsShouldProcess = $true )]
760+ Param (
761+ [Parameter (Mandatory = $true )]
762+ [string ] $Location ,
763+
764+ [Parameter (Mandatory = $true )]
765+ [string ] $Name
766+
767+ )
768+
769+ $resourceType = " Microsoft.Backup.Admin/backupLocations/backups"
770+ Invoke-AzsInfrastructureAction - Name $Name - Action " restore" - Location $Location - ResourceType $resourceType
771+ }
772+
773+ Export-ModuleMember - Function Restore-AzsBackup
774+
775+ <#
776+ . SYNOPSIS
777+ List Resource Provider Healths
778+ #>
779+
780+ function Get-AzsResourceProviderHealths {
781+ Param (
782+ [Parameter (Mandatory = $true )]
783+ [string ] $Location
784+
785+ )
786+
787+ $resourceType = " Microsoft.InfrastructureInsights.Admin/regionHealths/serviceHealths"
788+
789+ $rolehealth = Get-AzsInfrastructureResource - Location $Location - resourceType $resourceType
790+ $rolehealth.Properties
791+ }
792+
793+ Export-ModuleMember - Function Get-AzsResourceProviderHealths
794+
795+ <#
796+ . SYNOPSIS
797+ List Infrastructure Role Healths
798+ #>
799+
800+ function Get-AzsInfrastructureRoleHealths {
801+ Param (
802+ [Parameter (Mandatory = $true )]
803+ [string ] $Location
804+
805+ )
806+ $RP = Get-AzsResourceProviderHealths - Location $location | where {$_.DisplayName -eq " Capacity" }
807+ $ID = $RP.RegistrationID
808+ $resourceType = " Microsoft.InfrastructureInsights.Admin/regionHealths/serviceHealths/$ID /resourceHealths"
809+
810+ $rolehealth = Get-AzsInfrastructureResource - Location $Location - resourceType $resourceType
811+ $rolehealth.Properties
812+ }
813+
814+ Export-ModuleMember - Function Get-AzsInfrastructureRoleHealths
815+
649816function Get-AzsHomeLocation {
650817 param (
651818 [Parameter (Mandatory = $false )]
@@ -700,9 +867,12 @@ function Invoke-AzsInfrastructureAction {
700867 [string ] $Name ,
701868 [string ] $Location ,
702869 [string ] $Action ,
703- [string ] $ResourceType
870+ [string ] $ResourceType ,
871+
872+ [Parameter (Mandatory = $false )]
873+ [Hashtable ] $Parameters = $null
704874 )
705-
875+
706876 $Location = Get-AzsHomeLocation - Location $Location
707877
708878 $params = @ {
@@ -713,5 +883,10 @@ function Invoke-AzsInfrastructureAction {
713883 ResourceName = " {0}/{1}" -f $Location , $Name
714884 }
715885
886+ if ($Parameters )
887+ {
888+ $params.Parameters = $Parameters
889+ }
890+
716891 Invoke-AzureRmResourceAction @params - Force
717892}
0 commit comments