File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed
src/ResourceManager/Common/Commands.ScenarioTests.ResourceManager.Common Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -27,17 +27,21 @@ function New-AzureRmStorageAccount
27
27
[string ] [Parameter (Position = 0 , ValueFromPipelineByPropertyName = $true )] $ResourceGroupName ,
28
28
[string ] [Parameter (Position = 1 , ValueFromPipelineByPropertyName = $true )][alias (" StorageAccountName" )] $Name ,
29
29
[string ] [Parameter (Position = 2 , ValueFromPipelineByPropertyName = $true )] $Location ,
30
- [Microsoft.Azure.Management.Storage.Models.AccountType ] [Parameter (Position = 3 , ValueFromPipelineByPropertyName = $true )] $Type )
30
+ [string ] [Parameter (Position = 3 , ValueFromPipelineByPropertyName = $true )] $typeString )
31
31
BEGIN {
32
32
$context = Get-Context
33
33
$client = Get-StorageClient $context
34
34
}
35
35
PROCESS {
36
36
$createParms = New-Object - Type Microsoft.Azure.Management.Storage.Models.StorageAccountCreateParameters
37
- if ($Type -eq $null )
37
+ if ($typeString -eq $null )
38
38
{
39
39
$Type = [Microsoft.Azure.Management.Storage.Models.AccountType ]::StandardLRS
40
40
}
41
+ else
42
+ {
43
+ $Type = Parse- Type $typeString
44
+ }
41
45
42
46
$createParms.AccountType = $Type
43
47
$createParms.Location = $Location
@@ -118,6 +122,14 @@ function Get-Context
118
122
return $context
119
123
}
120
124
125
+ function Parse-Type
126
+ {
127
+ param ([string ] $type )
128
+ $type = $type.Replace (" _" , " " )
129
+ $returnSkuName = [System.Enum ]::Parse([Microsoft.Azure.Management.Storage.Models.AccountType ], $type )
130
+ return $returnSkuName ;
131
+ }
132
+
121
133
function Get-StorageClient
122
134
{
123
135
param ([Microsoft.Azure.Commands.Common.Authentication.Models.AzureContext ] $context )
You can’t perform that action at this time.
0 commit comments