gpt4 book ai didi

powershell - 使用 powershell 命令在 Azure 中创建 VM 时出现错误

转载 作者:行者123 更新时间:2023-12-03 00:01:28 25 4
gpt4 key购买 nike

我正在尝试使用 powershell 命令在 Azure 上创建 Windows 7 VM

$dclocation = 'East Asia'
$cloudSvcName = 'MyNewCloudServiceName'
$image = '03f55de797f546a1b29d1b8d66be687a__Windows-7-Enterprise-x64-en.us-201407.01'
$adminPassword = 'Admin@123'
$vmname = 'MyVMName'
New-AzureQuickVM -Windows -ServiceName $cloudSvcName -Name $vmname -ImageName $image -Location $dclocation -InstanceSize 'Basic_A0'

运行上面的代码时我收到错误:

New-AzureQuickVM : BadRequest: A ProvisioningConfigurationSet was not found in the ConfigurationSet collection of the virtual machine with name MyVMName. When creating a virtual machine from an image, ProvisioningConfigurationSet must be specified.
At line:4 char:1
+ New-AzureQuickVM -Windows -ServiceName $cloudSvcName -Name $vmname -ImageName $i ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : CloseError: (:) [New-AzureQuickVM], CloudException
+ FullyQualifiedErrorId : Microsoft.WindowsAzure.Commands.ServiceManagement.IaaS.PersistentVMs.NewQuickVM

提前致谢..

最佳答案

您还需要传入 -AdminUsername-Password 的值,例如

New-AzureQuickVM -Windows `
-ServiceName $cloudSvcName `
-Name $vmname `
-ImageName $image `
-Location $dclocation `
-InstanceSize 'Basic_A0' `
-AdminUsername $adminUsername `
-Password $adminPassword

关于powershell - 使用 powershell 命令在 Azure 中创建 VM 时出现错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26904477/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com