I have a problem with extracting artifacts. I have a task to download artifact from pipeline, once done it should extract zip file but it's throwing an error : Error: Failed rmRF: Command failed: rd /s /q "c:\Users\agent_002\xxx" The process cannot access the file because it is being used by another process.
I tried to check if I copy this file into another location and then try to unzip it but without any luck. Any ideas what process can use that and how to fix this ?
my code:
- stage: download_and_extract
jobs:
- job: download_pipeline_artefact
pool:
name: default
demands: agent.os -equals Windows_NT
steps:
- task: DownloadPipelineArtifact@2
inputs:
patterns: '**/*.zip'
path: $(Build.SourcesDirectory)/bin
- task: CopyFiles@2
inputs:
sourceFolder: $(Build.SourcesDirectory)/bin/
targetFolder: $(Build.SourcesDirectory)
- task: ExtractFiles@1
inputs:
archiveFilePatterns: '$(Build.SourcesDirectory)/xxx/xxx.zip'
Any ideas what I am doing wrong ?