diff --git a/.azure/pipelines/azure-pipelines-clean-agent.yml b/.azure/pipelines/azure-pipelines-clean-agent.yml index b52f9904..38869d11 100644 --- a/.azure/pipelines/azure-pipelines-clean-agent.yml +++ b/.azure/pipelines/azure-pipelines-clean-agent.yml @@ -32,22 +32,22 @@ steps: [bool]$CleanSourcesFolder = ${{parameters.CleanSourcesFolder}} [bool]$CleanPublishFolder = ${{parameters.CleanPublishFolder}} - if ($CleanArtifactsFolder -and Test-Path $env:BUILD_ARTIFACTSTAGINGDIRECTORY) { + if ($CleanArtifactsFolder -and (Test-Path $env:BUILD_ARTIFACTSTAGINGDIRECTORY)) { Write-Host -ForegroundColor Cyan "Cleaning folder $env:BUILD_ARTIFACTSTAGINGDIRECTORY" Remove-Item -Path "$env:BUILD_ARTIFACTSTAGINGDIRECTORY\*" -Filter '*.*' -Recurse -Force -ErrorAction SilentlyContinue } - if ($CleanBinariesFolder -and Test-Path $env:BUILD_BINARIESDIRECTORY) { + if ($CleanBinariesFolder -and (Test-Path $env:BUILD_BINARIESDIRECTORY)) { Write-Host -ForegroundColor Cyan "Cleaning folder $env:BUILD_BINARIESDIRECTORY" Remove-Item -Path "$env:BUILD_BINARIESDIRECTORY\*" -Filter '*.*' -Recurse -Force -ErrorAction SilentlyContinue } - if ($CleanSourcesFolder -and Test-Path $env:BUILD_SOURCESDIRECTORY) { + if ($CleanSourcesFolder -and (Test-Path $env:BUILD_SOURCESDIRECTORY)) { Write-Host -ForegroundColor Cyan "Cleaning folder $env:BUILD_SOURCESDIRECTORY" Remove-Item -Path "$env:BUILD_SOURCESDIRECTORY\*" -Filter '*.*' -Recurse -Force -ErrorAction SilentlyContinue } - if ($CleanPublishFolder -and Test-Path $env:BUILD_PUBLISHDIRECTORY) { + if ($CleanPublishFolder -and (Test-Path $env:BUILD_PUBLISHDIRECTORY)) { Write-Host -ForegroundColor Cyan "Cleaning folder $env:BUILD_PUBLISHDIRECTORY" Remove-Item -Path "$env:BUILD_PUBLISHDIRECTORY" -Filter '*.*' -Recurse -Force -ErrorAction SilentlyContinue }