Hello,
how to setup correctly global variables in PowerShell Sync Project?
I've created a custom command used in Connect, that takes some configuration parameters as input and sets global variables:
<CustomCommand Name="Init">
<![CDATA[
param(
[parameter(Mandatory=$true,ValueFromPipelineByPropertyName=$true)]
[ValidateNotNullOrEmpty()]
[String]$User,
[parameter(Mandatory=$true,ValueFromPipelineByPropertyName=$true)]
[ValidateNotNullOrEmpty()]
[String]$Pass
)
(... do some logic ...)
$global:AuthHeader = $header
]]>
</CustomCommand>
I tried to use this variable in other commands, with:
<SetParameter Param="Auth" Source="GlobalVariable" Value="AuthHeader" />
Unfortunately I always get: The argument is null or empty. Provide an argument that is not null or empty, and then try the command again.
What might be the problem?
Thank you,
Piotr Markiewicz