We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
function TestCompress() { [CmdLetBinding(SupportsShouldProcess=$true)] param ( [string]$source, [string]$dest ) PROCESS { Compress-Archive -Path $source -DestinationPath $dest } }
Call with TestCompress -source testfile -dest $env:temp\testfile.zip -WhatIf
TestCompress -source testfile -dest $env:temp\testfile.zip -WhatIf
Output should be:
What if: Performing the operation "Compress-Archive" on target ...\testfile.zip No zip file archive should be created.
Zip file archive is created in destination directory.
The -WhatIf parameter is passed through if Compress-Archive is replaced by Copy-Item in the function above.
Calling Compress-Archive with -WhatIf directly yields the correct results.
The text was updated successfully, but these errors were encountered:
This is fixed.
Sorry, something went wrong.
ayousuf23
Successfully merging a pull request may close this issue.
Steps to reproduce
Call with
TestCompress -source testfile -dest $env:temp\testfile.zip -WhatIf
Expected behavior
Output should be:
What if: Performing the operation "Compress-Archive" on target ...\testfile.zip
No zip file archive should be created.
Actual behavior
Zip file archive is created in destination directory.
Notes
The -WhatIf parameter is passed through if Compress-Archive is replaced by Copy-Item in the function above.
Calling Compress-Archive with -WhatIf directly yields the correct results.
The text was updated successfully, but these errors were encountered: