What is a best way to implement cancelation of PowerShell script?
i have case when should cancel of execution of powershell script outside. couldn’t break/kill process because script should rollback/commit state. best way this?
i found can send ctrl+c console , handle in blocks. considered powershell’s transaction, didn’t find way create powershell script.
thanks!
you use: break,throw,return,exit depending on want to achieve. check these links the behavior of these commands:
break: http://technet.microsoft.com/en-us/library/hh847873.aspx
throw:http://technet.microsoft.com/en-us/library/hh847766.aspx
return: http://technet.microsoft.com/en-us/library/hh847760.aspx
jaap brasser
http://www.jaapbrasser.com
Windows Server > Windows PowerShell
Comments
Post a Comment