我试图在$ osDiskUri变量中创建一个URL,该变量将在下面的powershell命令中使用。但是我收到错误消息“相对URI不支持此操作”
$SourceMachineName = 'NewSource'
$DestinationBlobStorageURL = 'https://myblobstorage.blob.core.windows.net/vhds/'
$osDiskUri = '{0}{1}Fix.vhd' -f $DestinationBlobStorageURL, $SourceMachineName
Set-AzureRmVMOSDisk -VM $vmConfig -Name "myOsDisk" -VhdUri $osDiskUri -CreateOption Attach -Windows
但是,如果我尝试通过$osDiskUri
中的硬编码路径,例如https://myblobstorage.blob.core.windows.net/vhds/OM-SourceFix.vhd
工作正常