Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/google-cloud-platform/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何使用Powershell在GCP虚拟机上启用虚拟显示?_Powershell_Google Cloud Platform_Display_Google Cloud Powershell - Fatal编程技术网

如何使用Powershell在GCP虚拟机上启用虚拟显示?

如何使用Powershell在GCP虚拟机上启用虚拟显示?,powershell,google-cloud-platform,display,google-cloud-powershell,Powershell,Google Cloud Platform,Display,Google Cloud Powershell,我正在使用“新建GceInstanceConfig”和“添加GceInstance”的组合创建GCP虚拟机,它工作正常。但是,我想添加打开虚拟显示的功能。我可以在控制台中完成这项工作,但是我需要关闭VM,启用设置,然后再打开VM,这很无聊。我希望能够在VM创建时在powershell中执行此操作,但在文档中找不到有关如何执行此操作的任何内容。我正在看文件 我找到了几个文档,它们解释了如何在控制台中使用REST或gcloud执行此操作。我似乎找不到使用Powershell的方法?您可以参考文档中的

我正在使用“新建GceInstanceConfig”和“添加GceInstance”的组合创建GCP虚拟机,它工作正常。但是,我想添加打开虚拟显示的功能。我可以在控制台中完成这项工作,但是我需要关闭VM,启用设置,然后再打开VM,这很无聊。我希望能够在VM创建时在powershell中执行此操作,但在文档中找不到有关如何执行此操作的任何内容。我正在看文件

我找到了几个文档,它们解释了如何在控制台中使用REST或gcloud执行此操作。我似乎找不到使用Powershell的方法?

您可以参考文档中的部分以启用虚拟显示


gcloud命令,如
gcloud计算实例创建[INSTANCE\u NAME]——启用显示设备
也可以在PowerShell中工作。您还需要以管理员身份运行PowerShell。

我最终将代码切换为使用gcloud命令而不是PowerShell命令来创建VM,并使其正常工作。

我查看了您链接的文档,这很有帮助-我已经能够使用其中记录的方法添加启用显示。但是,这在Powershell案例中没有帮助。我在提升的Powershell窗口中运行,能够创建虚拟机,没有问题,这只是我正在努力使用的显示选项。我尝试将--enable display device标志添加到我的Powershell命令中,但没有成功。如果将--enable display device添加到现有的新GceInstanceConfig命令,则在运行时会立即出现错误:System.Management.Automation.ParameterBindingException:找不到接受参数“--enable display device”的位置参数。如果将--enable display device添加到现有的add GceInstance命令,命令运行时说它创建了一个虚拟机,但是如果我查看门户,虚拟机没有创建。嘿@Mike,你也安装了for PowerShell吗?你好@Mike。是这样吗?