internal static System.Management.Automation.PowerShell Clear(this System.Management.Automation.PowerShell powershell) { if (powershell != null) { powershell.WaitForReady(); powershell.Commands = new PSCommand(); } return(powershell); }