I am trying to invoke a script (in a module) that takes a pscredential argument.
As far as I can tell, Cake.Powershell only allows string type args. But, maybe I am missing something. If so, please let me know if there is a way to pass a pscredential...
var someCred = new PSCredential(username, password.MakeSecure());
StartPowershellScript("Run-SomeScript", new PowershellSettings()
.OutputToAppConsole(false)
.WithModule(moduleFullPath)
.WithArguments(args =>
{
args.AppendSecret("SomeCredArgument", someCred);
}));
Sorry I don't think this will be possible. A simple work around would be to append string arguments to the external script then parse them into a PSCredential inside the Powershell script?
I am trying to invoke a script (in a module) that takes a pscredential argument.
As far as I can tell, Cake.Powershell only allows string type args. But, maybe I am missing something. If so, please let me know if there is a way to pass a pscredential...
Thanks!