PowerShell
ignore output
Add-Item > $null
Add-Item | Out-Null取得最後執行狀態碼
$?檔案操作
# 偵測檔案路徑存在
Test-Path "$DEPLOY_PATH\review\$CI_COMMIT_REF_NAME"
# 刪除檔案
Remove-Item "$DEPLOY_PATH\review\$CI_COMMIT_REF_NAME" -Recurse -Verbose -Force
# 複製檔案
Copy-Item -Path .\build\ -Destination "$DEPLOY_PATH\review\$CI_COMMIT_REF_NAME" -Recurse -Verbose -ForceLast updated