-
Notifications
You must be signed in to change notification settings - Fork 40
Closed
Labels
Milestone
Description
Copied from PowerShell/PowerShell#14245.
Steps to reproduce
$VerbosePreference = 'Ignore'
ni test.txt
Compress-Archive test.txt archive.zip
# this will be silent
echo 'expand without -Verbose'
Expand-Archive archive.zip outputDir
rm outputDir
# this will print multiple lines of verbose output
echo 'expand with-Verbose:$true'
Expand-Archive archive.zip outputDir -Verbose:$true
rm outputDir
# this will for some reason output a single verbose line, although it should be silent:
# VERBOSE: Performing the operation "Create Directory" on target "Destination: ...".
echo 'expand with -Verbose:$false'
Expand-Archive archive.zip outputDir -Verbose:$falseExpected behavior
-Verbose:$false should either behave the same as when -Verbose is not passed at all, or suppress all verbose output.
expand without -Verbose
expand with-Verbose:$true
VERBOSE: Performing the operation "Create Directory" on target "Destination: D:\test\outputDir".
VERBOSE: Preparing to expand...
VERBOSE: Performing the operation "Expand-Archive" on target "D:\test\archive.zip".
VERBOSE: Created 'D:\test\outputDir\test.txt'.
expand with -Verbose:$false
Actual behavior
-Verbose:$false causes unexpected verbose output.
expand without -Verbose
expand with-Verbose:$true
VERBOSE: Performing the operation "Create Directory" on target "Destination: D:\test\outputDir".
VERBOSE: Preparing to expand...
VERBOSE: Performing the operation "Expand-Archive" on target "D:\test\archive.zip".
VERBOSE: Created 'D:\test\outputDir\test.txt'.
expand with -Verbose:$false
VERBOSE: Performing the operation "Create Directory" on target "Destination: D:\test\outputDir".
Environment data
Name Value
---- -----
PSVersion 7.2.0-preview.1
PSEdition Core
GitCommitId 7.2.0-preview.1
OS Microsoft Windows 10.0.19041
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0