Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $ErrorActionPreference = "Stop"
- trap {
- Write-Error "$($Error[0] | Out-String)"
- echo hi
- Read-Host "Press enter"
- }
- Split-Path -BAD
- echo "Running script"
- Read-Host -Prompt "Press Enter to exit"
- Split-Path : A parameter cannot be found that matches parameter name 'BAD'.
- At line:8 char:16
- + Split-Path -BAD <<<<
- + CategoryInfo : InvalidArgument: (:) [Split-Path], ParameterBindingException
- + FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.PowerShell.Commands.SplitPathCommand
- + CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
- + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException
- $ErrorActionPreference = "Stop"
- trap {
- Write-Error $Error[0]
- echo hi
- Read-Host "Press enter"
- }
- Split-Path -BAD
- echo "Running script"
- Read-Host -Prompt "Press Enter to exit"
- A parameter cannot be found that matches parameter name 'BAD'.
- + CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
- + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement