Last active
November 10, 2019 21:16
-
-
Save MateuszNad/491940cf20493aa0fe4fbce57bc55ee0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$Error.Clear() | |
$oldErrorActionPreference = $ErrorActionPreference | |
$ErrorActionPreference = 'SilentlyContinue' | |
Get-Item -Path F:\file, D:\temp | |
if(-not $?) | |
{ | |
Write-Warning $Error[0].Exception.Message | |
} | |
$ErrorActionPreference = $oldErrorActionPreference |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment