Skip to content

Commit e904a3b

Browse files
committed
Add Backup Share, Change FRU cmdlet parameter scaleunitnodename
1 parent b7857d3 commit e904a3b

File tree

1 file changed

+40
-6
lines changed

1 file changed

+40
-6
lines changed

Infrastructure/AzureStack.Infra.psm1

Lines changed: 40 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,7 @@ function Repair-AzsScaleUnitNode {
559559

560560
[Parameter(Mandatory = $true)]
561561
[ValidateNotNullorEmpty()]
562-
[string] $ScaleUnitNodeName,
562+
[string] $Name,
563563

564564
[Parameter(Mandatory = $true)]
565565
[ValidateNotNullorEmpty()]
@@ -575,7 +575,7 @@ function Repair-AzsScaleUnitNode {
575575
bmcIPv4Address = $BMCIPv4Address
576576
}
577577

578-
Invoke-AzsInfrastructureAction -Action "Repair" -Name $ScaleUnitNodeName -Location $Location -ResourceType $resourceType -Parameters $parameters
578+
Invoke-AzsInfrastructureAction -Action "Repair" -Name $Name -Location $Location -ResourceType $resourceType -Parameters $parameters
579579
}
580580
}
581581

@@ -594,15 +594,15 @@ function Stop-AzsScaleUnitNode {
594594

595595
[Parameter(Mandatory = $true)]
596596
[ValidateNotNullorEmpty()]
597-
[string] $ScaleUnitNodeName,
597+
[string] $Name,
598598

599599
[switch] $Force
600600
)
601601

602602
if ($Force.IsPresent -or $PSCmdlet.ShouldContinue("Are you sure you want to stop scale unit node $ScaleUnitNodeName ?", "")) {
603603
$resourceType = "Microsoft.Fabric.Admin/fabricLocations/scaleunitnodes"
604604

605-
Invoke-AzsInfrastructureAction -Action "PowerOff" -Name $ScaleUnitNodeName -Location $Location -ResourceType $resourceType
605+
Invoke-AzsInfrastructureAction -Action "PowerOff" -Name $Name -Location $Location -ResourceType $resourceType
606606
}
607607
}
608608

@@ -621,15 +621,15 @@ function Start-AzsScaleUnitNode {
621621

622622
[Parameter(Mandatory = $true)]
623623
[ValidateNotNullorEmpty()]
624-
[string] $ScaleUnitNodeName,
624+
[string] $Name,
625625

626626
[switch] $Force
627627
)
628628

629629
if ($Force.IsPresent -or $PSCmdlet.ShouldContinue("Are you sure you want to start scale unit node $ScaleUnitNodeName ?", "")) {
630630
$resourceType = "Microsoft.Fabric.Admin/fabricLocations/scaleunitnodes"
631631

632-
Invoke-AzsInfrastructureAction -Action "PowerOn" -Name $ScaleUnitNodeName -Location $Location -ResourceType $resourceType
632+
Invoke-AzsInfrastructureAction -Action "PowerOn" -Name $Name -Location $Location -ResourceType $resourceType
633633
}
634634
}
635635

@@ -861,6 +861,40 @@ function Get-AzsInfrastructureResource {
861861

862862
Export-ModuleMember -Function Set-AzsLocationInformation
863863

864+
<#
865+
.SYNOPSIS
866+
Set Backup Share
867+
#>
868+
function Set-AzSBackupShare {
869+
Param(
870+
[Parameter(Mandatory = $false)]
871+
[string] $Location,
872+
873+
[Parameter(Mandatory = $true)]
874+
[string]$Path,
875+
876+
[Parameter(Mandatory = $true)]
877+
[string]$UserName,
878+
879+
[Parameter(Mandatory = $true)]
880+
[string]$Password
881+
)
882+
883+
$Location = Get-AzsHomeLocation -Location $Location
884+
885+
$params = @{
886+
ResourceName = "{0}/{1}" -f $Location
887+
ResourceType = "Microsoft.Backup.Admin/backupLocations"
888+
ResourceGroupName = "system.{0}" -f $Location
889+
ApiVersion = "2016-05-01"
890+
Properties = @{externalStoreDefault=@{path = $Path;userName = $UserName;password = $Password }}
891+
}
892+
893+
New-AzureRmResource @params -Force
894+
}
895+
896+
Export-ModuleMember -Function Set-AzSBackupShare
897+
864898

865899
function Invoke-AzsInfrastructureAction {
866900
param(

0 commit comments

Comments
 (0)