简体   繁体   English

无法通过 gcloud 谷歌云平台删除磁盘

[英]Can´t delete disks through gcloud google cloud platform

I'm trying to delete a disk through gcloud but it does not work :/.我正在尝试通过 gcloud 删除磁盘,但它不起作用:/。 Every other command works (create, attach, detach).所有其他命令都有效(创建、附加、分离)。

This is the code im using:这是我使用的代码:

gcloud auth activate-service-account account@project.iam.gserviceaccount.com --key-file=KEY
gcloud compute disks delete disk_name --zone=europe-west3-b

When i execute the code nothing happens.当我执行代码时,什么也没有发生。 If i press "stop operation" it will stay on that status forever and i have to restart Powershell.如果我按“停止操作”,它将永远保持该状态,我必须重新启动 Powershell。 The Service-Account has compute instance administrator rights (v1) so it can`t be that. Service-Account 具有计算实例管理员权限 (v1),因此不能那样。

Updated to the newest version but it didn't change anything.更新到最新版本,但它没有改变任何东西。

Thanks in advance :)提前致谢 :)

This problem related to Powershell ISE that can't return prompts from gcloud .此问题与无法从gcloud返回提示的Powershell ISE相关。 It could be solved by following the documentation Scripting gcloud CLI commands :它可以通过遵循文档脚本 gcloud CLI 命令来解决:

Cloud SDK comes with a variety of tools like filtering, formatting, and the --quiet flag , enabling you to effectively handle output and automate tasks. Cloud SDK 附带了各种工具,例如过滤、格式化和--quiet 标志,使您能够有效地处理输出和自动执行任务。

and using flag -q .并使用标志-q

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM