Question How to know that the command on powershell is completed successfully

Ralston18

Titan
Moderator
In agreement with all of the above.

Overall more information is needed about the specific requirements you need with respect to any given cmdlet or script.

Basically, as I understand your post you simply want to know that there were no errors and what you wanted to have happen actually happened.

Likely a bit tricky....

And better fitted to scripts I think versus just running an one liner cmdlet.

====

Powershell has error handling and exception capabilities....

try

catch

finally

References:

https://www.webservertalk.com/powershell-try-catch-tutorial-guide

https://www.tutorialspoint.com/explain-try-catch-finally-block-in-powershell
 

ASK THE COMMUNITY

TRENDING THREADS