I’m trying to use environment variables in a workflow:
workflow foobar { [CmdletBinding()] Param ( [string]$Path = "$env:HOMEDRIVE\Test\Files" ) }
Running this workflow returns the error:
"In a windows PowerShell workflow, parameter defaults may only be simple value types (such as integers) and strings. In addition, the type of the default value must match the type of the parameter."
If I change the parameter to:
C:\Test\Files
That is a solution. But is there a way to use environment variables (in the param block), in a workflow?
Homedrive might not always be C: in my environment.