Greetings All,
When using PowerShell Workflows, I have a function which returns a $PSCredential object, and workflow code that assigns the return to a variable. The function call enters and exits wonderfully with just about any other value, primitive or complex type, but the minute you try to return something of type PSCredential, the workflow hangs indefinitely. See below for example. Thoughts?
workflow wf {
function f1 {return "Value from f1"}
function f2 {return (New-Object [PSCredential]("User","Password"))}
$f1Return = f1
Write-Output $f1Return
#Code will not get past the next line. Workflow hangs.
$f2Return = f2
Write-Output $f2Return
}