【发布时间】:2017-11-08 23:56:36
【问题描述】:
我正在使用以下批处理文件下载并解压缩 google-cloud-sdk,
文件名:download.bat
set home=%USERPROFILE%
echo %home%
%WINDIR%\System32\WindowsPowerShell\v1.0\powershell.exe -Command "(New-Object Net.WebClient).DownloadFile('https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-179.0.0-windows-x86_64-bundled-python.zip', '%home%/google-cloud-sdk.zip');& { Add-Type -A 'System.IO.Compression.FileSystem'; [IO.Compression.ZipFile]::ExtractToDirectory('%home%/google-cloud-sdk.zip', '%home%/google-cloud-sdk'); }"
我正在使用以下批处理文件在 Windows 上静默安装 SDK,
文件名:install_win.bat
call %USERPROFILE%\google-cloud-sdk\google-cloud-sdk\install.bat --path-update=true --usage-reporting=false --command-completion=false
当我尝试使用以下命令从另一个批处理文件授权我的服务帐户时成功完成这些步骤后,
gcloud auth activate-service-account --key-file {json fila path}
它失败并告诉我 glcoud 无法识别内部或外部命令。
谁能帮我解决这个错误? 我认为该错误是因为 Windows 中缺少 SDK 的 bin 文件的环境变量。 如何从批处理文件中设置?
【问题讨论】:
标签: windows batch-file google-cloud-platform gcloud