Prerequisites
Steps to reproduce
I don't see documentation describe this behavior? The doc only mentioned exit code.
& {
$ErrorActionPreference = 'Continue'
$PSNativeCommandUseErrorActionPreference = $true
# expected error:
robocopy 1>$null # NativeCommandExitException: Program "Robocopy.exe" ended with non-zero exit code: 16 (0x00000010).
# error discarded:
robocopy 1>$null 2>$null # no error
robocopy 1>$null 2>&1 # effectively discarded, so no error
# not discarded
robocopy 2>&1 # NativeCommandExitException: Program "Robocopy.exe" ended with non-zero exit code: 16 (0x00000010).
}
Expected behavior
Only exit code matters for the action
Actual behavior
err stream affects the action
Error details
Environment data
Name Value
---- -----
PSVersion 7.6.2
PSEdition Core
GitCommitId 7.6.2
OS Microsoft Windows 10.0.19045
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.4
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Visuals
No response
Prerequisites
Steps to reproduce
I don't see documentation describe this behavior? The doc only mentioned exit code.
Expected behavior
Only exit code matters for the actionActual behavior
err stream affects the actionError details
Environment data
Visuals
No response