Skip to content

Get-PnpException how to get exception for last command or clear the history #1764

Answered by AndersRask
davepile asked this question in Q&A
Discussion options

You must be logged in to vote

Hey

Usually I use try/catch, but you have to either set
-Erroraction Stop
For that to work (not all exceptons are terminal) or set error level globally to stop

If you provide a sample of your issue I might better understand your specific issue

Get-PnPException just shows latest error in error stream in a readable format ($Error[0])

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@davepile
Comment options

Answer selected by davepile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants