Assembly: System.Management.Automation (in System.Management.Automation.dll)
protected internal virtual bool ShouldRun ( CommandInfo commandInfo, CommandOrigin origin, PSHost host, out Exception reason )
protected boolean ShouldRun ( CommandInfo commandInfo, CommandOrigin origin, PSHost host, /** @attribute OutAttribute() */ /** @ref */ Exception reason )
A CommandInfo object that describes the command to be run.
A CommandOrigin object that describes the dispatch origin of the command.
A PSHost object that describes the host that provides communications between the Windows PowerShell runtime and the command line.
If your authorization policy blocks the execution of a command, this parameter holds an Exception object that contains the reason why the command was blocked. When deriving from this class, be sure to populate this parameter with an exception describing the reason why your implementation blocked the execution of the command.
Return ValueTrue if the command should be run; otherwise, false is returned.
When deriving from this class to create your own authorization policy, override this method with the logic specific to your needs.