-
Notifications
You must be signed in to change notification settings - Fork 40
Closed
Description
Using compress-archive cmdlet in powershell, doesn't seem to return a proper error code when the compression level is invalid.
Could you please check?
Sample code below. Please make a note of invalid compression level.
$somethingworked=$false
compress-archive -path "c:\source" -destinationpath "C:\source\test.zip" -Force -compressionlevel test
$lastExitCode
if ( $LASTEXITCODE -ne 0) {
throw "Last command was not successful"
}else {
$somethingworked=$true
Write-Host "Value for the boolean variable: $somethingworked"
}
if( $somethingworked) {
Write-Host "Hey.. Now I'm able to check the previous step's status and it was successful"
}