Rac*_*hel 2 azure azure-powershell azure-devops azure-pipelines azure-yaml-pipelines
我尝试在 Azure Yaml Pipelines 中运行 PowerShell 脚本,但收到此错误:
##[error]The term 'D:\a\1\s\myPowershellFile.ps1' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
Run Code Online (Sandbox Code Playgroud)
代码:
jobs:
- deployment: Deploy
displayName: Deploy
environment: $(myEnvironment)
pool:
vmImage: 'windows-latest'
strategy:
runOnce:
deploy:
steps:
- task: AzurePowerShell@5
displayName: 'Run Powershell script'
inputs:
azureSubscription: $(azureConnectionName)
scriptType: filePath
scriptPath: './myPowershellFile.ps1'
azurePowerShellVersion: latestVersion
Run Code Online (Sandbox Code Playgroud)
该文件被推送到触发构建的分支的存储库。$(Pipeline.Workspace)我还尝试使用and显式引用路径$(Build.SourcesDirectory)。版本 4 也不起作用。根据文档,这应该有效!
| 归档时间: |
|
| 查看次数: |
3384 次 |
| 最近记录: |