以下代码示例在buildspec.yml文件中使用pwsh.exe(powershell 7)作为默认的shell:
version: 0.2
phases:
install:
runtime-versions:
powershell: 7.0
build:
commands:
- pwsh -Command "echo Hello from PowerShell 7"
然后可以使用以下命令将此文件添加到CodeBuild项目中:
$ aws codebuild create-project --name my-project --source ... --environment-variable-overrides "Name=SCRIPT_SHELL,Value=pwsh.exe"
上一篇:AWSCodeBuild-更新构建项目环境时,出现非常无用的错误消息
下一篇:AWSCodebuild-在UPLOAD_ARTIFACTS阶段出现错误:BucketRegionError:错误地区,存储桶不在“us-east-2”区域的端点。