@@ -5,15 +5,15 @@ function Get-AzureRmStorageAccount
5
5
[CmdletBinding ()]
6
6
param (
7
7
[string ] [Parameter (Position = 0 , ValueFromPipelineByPropertyName = $true )] $ResourceGroupName ,
8
- [string ] [Parameter (Position = 1 , ValueFromPipelineByPropertyName = $true )] $Name )
8
+ [string ] [Parameter (Position = 1 , ValueFromPipelineByPropertyName = $true )] [ alias ( " StorageAccountName " )] $Name )
9
9
BEGIN {
10
10
$context = Get-Context
11
11
$client = Get-StorageClient $context
12
12
}
13
13
PROCESS {
14
14
$getTask = $client.StorageAccounts.GetPropertiesAsync ($ResourceGroupName , $name , [System.Threading.CancellationToken ]::None)
15
15
$sa = $getTask.Result
16
- $account = Get-StorageAccount $sa $ResourceGroupName
16
+ $account = Get-StorageAccount $ResourceGroupName $Name
17
17
Write-Output $account
18
18
}
19
19
END {}
@@ -25,7 +25,7 @@ function New-AzureRmStorageAccount
25
25
[CmdletBinding ()]
26
26
param (
27
27
[string ] [Parameter (Position = 0 , ValueFromPipelineByPropertyName = $true )] $ResourceGroupName ,
28
- [string ] [Parameter (Position = 1 , ValueFromPipelineByPropertyName = $true )] $Name ,
28
+ [string ] [Parameter (Position = 1 , ValueFromPipelineByPropertyName = $true )][ alias ( " StorageAccountName " )] $Name ,
29
29
[string ] [Parameter (Position = 2 , ValueFromPipelineByPropertyName = $true )] $Location ,
30
30
[string ] [Parameter (Position = 3 , ValueFromPipelineByPropertyName = $true )] $Type )
31
31
BEGIN {
@@ -38,8 +38,6 @@ function New-AzureRmStorageAccount
38
38
$createParms.Location = $Location
39
39
$getTask = $client.StorageAccounts.CreateAsync ($ResourceGroupName , $name , $createParms , [System.Threading.CancellationToken ]::None)
40
40
$sa = $getTask.Result
41
- $account = Get-StorageAccount $ResourceGroupName $Name
42
- Write-Output $account
43
41
}
44
42
END {}
45
43
@@ -50,7 +48,7 @@ function Get-AzureRmStorageAccountKey
50
48
[CmdletBinding ()]
51
49
param (
52
50
[string ] [Parameter (Position = 0 , ValueFromPipelineByPropertyName = $true )] $ResourceGroupName ,
53
- [string ] [Parameter (Position = 1 , ValueFromPipelineByPropertyName = $true )] $Name )
51
+ [string ] [Parameter (Position = 1 , ValueFromPipelineByPropertyName = $true )] [ alias ( " StorageAccountName " )] $Name )
54
52
BEGIN {
55
53
$context = Get-Context
56
54
$client = Get-StorageClient $context
@@ -62,6 +60,25 @@ function Get-AzureRmStorageAccountKey
62
60
END {}
63
61
}
64
62
63
+ function Remove-AzureRmStorageAccount
64
+ {
65
+
66
+ [CmdletBinding ()]
67
+ param (
68
+ [string ] [Parameter (Position = 0 , ValueFromPipelineByPropertyName = $true )] $ResourceGroupName ,
69
+ [string ] [Parameter (Position = 1 , ValueFromPipelineByPropertyName = $true )] [alias (" StorageAccountName" )] $Name )
70
+ BEGIN {
71
+ $context = Get-Context
72
+ $client = Get-StorageClient $context
73
+ }
74
+ PROCESS {
75
+ $getTask = $client.StorageAccounts.DeleteAsync ($ResourceGroupName , $name , [System.Threading.CancellationToken ]::None)
76
+ $sa = $getTask.Result
77
+ }
78
+ END {}
79
+
80
+ }
81
+
65
82
function Get-Context
66
83
{
67
84
[Microsoft.Azure.Commands.Common.Authentication.Models.AzureContext ]$context = $null
@@ -88,6 +105,9 @@ function Get-StorageClient
88
105
89
106
function Get-StorageAccount {
90
107
param ([string ] $resourceGroupName , [string ] $name )
91
- $sa = New-Object PSObject - Property @ {" Name" = $name ; " ResourceGroupName" = $resourceGroupName }
108
+ $endpoints = New-Object PSObject - Property @ {" Blob" = " https://$name .blob.core.windows.net/" }
109
+ $sa = New-Object PSObject - Property @ {" Name" = $name ; " ResourceGroupName" = $resourceGroupName ;
110
+ " PrimaryEndpoints" = $endpoints
111
+ }
92
112
return $sa
93
113
}
0 commit comments