简体   繁体   English

控制点 | 如何在 PowerShell 中进行 gcloud init

[英]GCP | How to gcloud init in PowerShell

When running gcloud init on PowerShell, the scripts seems to stop short and won't keep running.在 PowerShell 上运行 gcloud init 时,脚本似乎突然停止并且不会继续运行。

gcloud init

What it shows:它显示了什么:

python.exe : Welcome! This command will take you through the configuration of gcloud.
At C:\Users\minh.tran\AppData\Local\Google\Cloud SDK\google-cloud-sdk\bin\gcloud.ps1:117 char:3
+   & "$cloudsdk_python" $run_args_array
+   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (Welcome! This c...tion of gcloud.:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError
 
Settings from your current configuration [dev-finops] are:
accessibility:
  screen_reader: 'False'
core:
  account: minh.tran@hireright.com
  disable_usage_reporting: 'True'
  project: prj-d-finops
proxy:
  address: 10.35.2.194
  password: HireR1ght2022!
  port: '8080'
  type: http
  username: corp\minh.tran
Pick configuration to use:
 [1] Re-initialize this configuration [dev-finops] with new settings 
 [2] Create a new configuration
 [3] Switch to and re-initialize existing configuration: [default]

gcloud init running on cloud shell or cmd will return the following and wait for user input:在云 shell 或 cmd 上运行的 gcloud init 将返回以下内容并等待用户输入:

Welcome! This command will take you through the configuration of gcloud.

Settings from your current configuration [dev-finops] are:
accessibility:
  screen_reader: 'False'
core:
  account: minh.tran@hireright.com
  disable_usage_reporting: 'True'
  project: prj-d-finops
proxy:
  address: 10.35.2.194
  password: HireR1ght2022!
  port: '8080'
  type: http
  username: corp\minh.tran

Pick configuration to use:
 [1] Re-initialize this configuration [dev-finops] with new settings
 [2] Create a new configuration
 [3] Switch to and re-initialize existing configuration: [default]
Please enter your numeric choice:

How do I get gcloud init to run on PowerShell?如何让 gcloud init 在 PowerShell 上运行? What issue do I have here?我这里有什么问题?

Please see the below requirement:请看下面的要求:

Cloud SDK requires Python; supported versions are Python 3 (3.5 to 3.9). By default, the Windows version of Cloud SDK comes bundled with Python 3. To use Cloud SDK, your operating system must be able to run a supported version of Python.

In order to install python 3.9 on windows, just use this installer https://www.python.org/ftp/python/3.9.13/python-3.9.13-amd64.exe .为了在 windows 上安装 python 3.9,只需使用此安装程序https://www.python.org/ftp/python/3.9.13/python-3.9.13-amd64.exe

Be sure to close and reopen the powershell prompt after installation in order to load the new PATH where python executable is added.确保在安装后关闭并重新打开 powershell 提示,以便加载添加了 python 可执行文件的新 PATH。

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

相关问题 如何使用 gcloud 命令使用 accessConfig 创建 GCP 实例模板 - How to create GCP Instance-Template with accessConfig using gcloud command 如何使用 gcloud sdk 创建没有 default.network 的 gcp 项目 - how to create gcp projects without default network using gcloud sdk 如何使用 gcloud 命令工具将 GCP IAM 策略附加到资源? - How attach a GCP IAM policy to a resource with gcloud command tool? 如何让 shell 脚本在 PowerShell 中的 gcloud CLI 上工作? - How to get shell script to work on gcloud CLI in PowerShell? gcloud (GCP) 的值列表(多个值) - A list of values (multiple values) with gcloud (GCP) 如何使用 gcloud python 库或使用请求库列出所有 GCP 文件夹? - How to list all GCP folders by using gcloud python libraries or by using request library? GCP / gcloud:您的应用程序可能没有超过 N 个版本 - 如何自动删除旧版本? - GCP / gcloud : Your app may not have more than N versions - how to remove old versions automatically? 尝试使用“gcloud init”进行身份验证时出错 - Error while trying to authenticate with `gcloud init` GCP Cloud Functions Gen 2 - 无法通过 NodeJs 或 gcloud 调用 - GCP Cloud Functions Gen 2 - Cannot call through NodeJs or gcloud gcloud compute ssh powershell 中的端口转发 - gcloud compute ssh port forwarding in powershell
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM