问题描述
我想为DC创建VM,因此假设Windows Server是最佳图像。
I would like to create VM for DC so assuming that Windows Server is best image.
脚本可能出现什么问题?
What could be wrong with script?
#创建DC VM配置
$ BEVMName =" DCVM"
$ BEVMConfig = New-AzVMConfig -VMName $ BEVMName -VMSize Standard_D1 | `
Set-AzVMOperatingSystem -Windows -ComputerName $ BEVMName -Credential $ Cred -ProvisionVMAgent -EnableAutoUpdate | `
Set-AzVMSourceImage-VM -PublisherName" MicrosoftWindowsServer" -Offer"WindowsServer" -Skus" 2016-Datacenter" -Version"最新" | `
Add-AzVMNetworkInterface -Id $ backendNic.Id
#创建DC VM
New-AzVM -ResourceGroupName $ ResourceGroupName -Location $位置-VM $ BEVMConfig
# Create DC VM configuration
$BEVMName = "DCVM"
$BEVMConfig = New-AzVMConfig -VMName $BEVMName -VMSize Standard_D1 | `
Set-AzVMOperatingSystem -Windows -ComputerName $BEVMName -Credential $Cred -ProvisionVMAgent -EnableAutoUpdate | `
Set-AzVMSourceImage-VM -PublisherName "MicrosoftWindowsServer" -Offer "WindowsServer" -Skus "2016-Datacenter" -Version "latest" | `
Add-AzVMNetworkInterface -Id $backendNic.Id
# Create the DC VM
New-AzVM -ResourceGroupName $ResourceGroupName -Location $Location -VM $BEVMConfig
错误:
Kenny_I
推荐答案
命令是Set-AzVMSourceImage,最后没有-VM。
The Command is Set-AzVMSourceImage without -VM in the end.
试试这个:
这篇关于无法创建VM - 无法识别“Set-AzVMSourceImage-VM”一词的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!