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
  • Yes, I did unfortunately I haven't saved the xml of incorrect configuration.

    I've tried to reproduce the error now, and it works, the value is passed correctly.
    It must have been an error with the call (var name maybe). No idea why I was experiencing issues yesterday.

    I was able to use the SetParameter correctly.
Reply
  • Yes, I did unfortunately I haven't saved the xml of incorrect configuration.

    I've tried to reproduce the error now, and it works, the value is passed correctly.
    It must have been an error with the call (var name maybe). No idea why I was experiencing issues yesterday.

    I was able to use the SetParameter correctly.
Children
No Data