private static bool ExecutePowerShellScript(ExecutionContext executionContext, string script) { return(PowerShellScriptExecuter.Execute( script, data => { if (data != null) { executionContext.Outputter.Write(data); } }, data => { if (data != null) { executionContext.Outputter.WriteError(data); } })); }
private static bool ExecutePowerShellScript(ExecutionContext executionContext, string script) { return(PowerShellScriptExecuter.Execute( script, data => { if (data != null) { executionContext.Outputter.Write(data?.ToString() ?? "PowerShell: <no information output>"); } }, data => { if (data != null) { executionContext.Outputter.WriteError(data?.ToString() ?? "PowerShell: Error while executing command."); } })); }