This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

PS1 Sync project - global variables

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

Parents Reply Children
No Data