Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $Error.count # empty automatic variable
- # throwing an error when file doesn't exists
- Get-Item C:\Data\nosuchfile.txt
- $Error.count # one error record logged
- # supressing the error
- Get-Item C:\Data\nosuchfile.txt -ErrorAction SilentlyContinue
- $Error.count # but still capturing the error
- # supress the error but not logging it in $Error variable
- Get-Item C:\Data\nosuchfile.txt -ErrorAction Ignore
- $Error.count
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement