【发布时间】:2021-09-18 11:15:42
【问题描述】:
我的目标是将新驱动器附加到 Windows VM 映射到 Azure 文件共享 这需要通过 Terraform 完成
$UserName = $StorageAccount
$SecurePassword = ConvertTo-SecureString $StorageAccountKey -AsPlainText -Force
$Credentials = New-Object System.Management.Automation.PSCredential -ArgumentList $UserName, $SecurePassword
# Mount the drive
If (!(Test-Path O:)) {
New-PSDrive -Name "O" -PSProvider "FileSystem" -Root "\\$StorageAccount.file.core.windows.net\$FileShareName" -Persist -Scope "Global" -Credential $Credentials
}
else { Write-Host "The O: drive is already in use." }
我得到的错误是
New-PSDrive : 指定的网络密码不正确
请帮忙
【问题讨论】:
-
这几乎是不言自明的。
-
我检查了密码,它是正确的
标签: windows azure powershell terraform