在 Windows VM 实例上远程 运行 脚本的最佳方法是什么?

What is the best way to run a script remotely on Windows VM instance?

例如,在 Linux VM 实例中,我们可以使用 gcloud beta ssh 命令远程使用 运行 命令,方法是使用 gcp 凭证下载 ssh 密钥

同样,我正在 Windows VM 实例上远程寻找 运行ning 脚本,而不对实例执行 RDP。

有人可以指出这个问题的解决方案吗?

如果您的 Windows 工作站带有 PowerShell,您可以通过远程 PowerShell 会话连接到 Windows 服务器实例。此过程类似于使用 SSH 连接到 Linux 实例。请查看 "Connecting to Windows instances using the PowerShell terminal"

https://cloud.google.com/compute/docs/instances/connecting-advanced#powershell