Azure pipeline can't find script when preceded by other task

Viewed 27

In my yaml file I have two tasks : CopyFiles and run a Powershell script.

If only the Powershell task is there, then no problem. I runs fine. So the ScriptPath is OK. But with the CopyFiles task preceding, it isn't able to find the Powershell file anymore (see screenshot). Anyone has an idea?

jobs:
- job: sync_wiki_repo
  displayName: 'Sync wiki'
  steps:
  - checkout: wiki
  - task: CopyFiles@2
    displayName: Copy wiki files
    inputs:
      contents: 'Wiki/Distribution/Client-Welcome-Page/Readme.md' 
      **targetFolder**: '$(System.DefaultWorkingDirectory)/wiki-staging'
      overWrite: true
  - checkout: git://something/set-wiki #checkout specific branch
  - task: AzurePowerShell@5
    displayName: 'Set wiki'
    inputs:
      azureSubscription: 'mysub'
      ScriptType: 'FilePath'
      **ScriptPath**: '1.0/scripts/sync-wiki-repo.ps1'      
      ScriptArguments: '-wikipat $(e2e-pipelines-manage-wiki-secret) -project ${{parameters.project}}'
      azurePowerShellVersion: 6.4.0
      workingDirectory: '$(System.DefaultWorkingDirectory)'

Text

1 Answers

As this is running on an Ubuntu Linux machines, the names of the folders and files are case sensitive. I doublechecked that. And I added "E2E-Pipelines" to the Scriptpath.

ScriptPath:'E2E-Pipelines/1.0/scripts/sync-wiki-repo.ps1'

Now my powershell file can be found. It is solved.

Related