我正在尝试创建一个存储组,并遇到了一些问题.
这是我正在使用的代码:
$StorageAccountName = 'myazurefileshare'
$Share = 'FileShare'
$Location = 'North Europe'
$ac = Get-AzureStorageAccount -StorageAccountName $StorageAccountName -ErrorAction SilentlyContinue
"Storage account exists? [$(if ($ac) {$true} else {$false})]"
If (!$ac) # Does not exist - so create it
{
Write-Verbose "Storage Account [$StorageAccountName] in [$Location] does not exist"
Write-Verbose "Creating Storage Account [$StorageAccountName] in [$Location]"
New-AzureStorageAccount -StorageAccountName $StorageAccountName `
-Location $Location -type 'Standard_GRS'
}
Run Code Online (Sandbox Code Playgroud)
如果我用详细的方式运行它,我得到这个:
VERBOSE: 19:58:11 - Begin Operation: Get-AzureStorageAccount
VERBOSE: 19:58:12 - Completed Operation: Get-AzureStorageAccount
Storage account exists? [False] …
Run Code Online (Sandbox Code Playgroud)