我让Jobs在 YAML 管道中正常工作,但是当我将其更改为Deployment Job时,路径无法正常工作。
jobs:
- job: InfrastructureAsCodeDeployment
pool:
name: Azure Pipelines
vmImage: windows-2019
steps:
- task: "AzurePowerShell@2"
displayName: 'Azure PowerShell script: Remove Keyvault'
inputs:
azureSubscription: 'Connection name'
ScriptType: 'FilePath'
ScriptPath: 'Powershell Scripts/IAC/kv-RemoveExistingSoftDeleted.ps1'
ScriptArguments: '-vaultName $(keyVaultName) -location "$(location)"'
azurePowerShellVersion: 'LatestVersion'
continueOnError: true
在部署工作之后:-
jobs:
- deployment: InfrastructureAsCodeDeployment
pool:
name: Azure Pipelines
vmImage: windows-2019
environment: 'DEV'
strategy:
runOnce:
deploy:
steps:
- task: "AzurePowerShell@2"
displayName: 'Azure PowerShell script: Remove Keyvault'
inputs:
azureSubscription: 'Connection name'
ScriptType: 'FilePath'
ScriptPath: 'Powershell Scripts/IAC/kv-RemoveExistingSoftDeleted.ps1'
ScriptArguments: '-vaultName $(keyVaultName) -location "$(location)"'
azurePowerShellVersion: 'LatestVersion'
continueOnError: true
尝试将“System.DefaultWorkingDirectory”添加到部署,但仍然不起作用。