Skip to content

Commit 8d1a975

Browse files
committed
adding ability to create storage accounts of different types
1 parent a38af8d commit 8d1a975

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/ResourceManager/Common/Commands.ScenarioTests.ResourceManager.Common/AzureRM.Storage.ps1

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,19 @@ function New-AzureRmStorageAccount
2727
[string] [Parameter(Position=0, ValueFromPipelineByPropertyName=$true)] $ResourceGroupName,
2828
[string] [Parameter(Position=1, ValueFromPipelineByPropertyName=$true)][alias("StorageAccountName")] $Name,
2929
[string] [Parameter(Position=2, ValueFromPipelineByPropertyName=$true)] $Location,
30-
[string] [Parameter(Position=3, ValueFromPipelineByPropertyName=$true)] $Type)
30+
[Microsoft.Azure.Management.Storage.Models.AccountType] [Parameter(Position=3, ValueFromPipelineByPropertyName=$true)] $Type)
3131
BEGIN {
3232
$context = Get-Context
3333
$client = Get-StorageClient $context
3434
}
3535
PROCESS {
3636
$createParms = New-Object -Type Microsoft.Azure.Management.Storage.Models.StorageAccountCreateParameters
37-
$createParms.AccountType = [Microsoft.Azure.Management.Storage.Models.AccountType]::StandardLRS
37+
if ($Type -eq $null)
38+
{
39+
$Type = [Microsoft.Azure.Management.Storage.Models.AccountType]::StandardLRS
40+
}
41+
42+
$createParms.AccountType = $Type
3843
$createParms.Location = $Location
3944
$getTask = $client.StorageAccounts.CreateAsync($ResourceGroupName, $name, $createParms, [System.Threading.CancellationToken]::None)
4045
$sa = $getTask.Result

0 commit comments

Comments
 (0)