How to define project variable as an array?

OrangeBeanOrangeBean Posts: 8
edited August 26, 2014 2:57AM in Deployment Manager
Hi,

I'm wondering if anyone out there can answer my question in Sabj.? Search on the forum and Google did not help.

Basically Deploy.ps1 of the package expects an array as a parameter. How can I declare an array project variable in Deployment Manager?

$WebServers = @('server1','server2')

Comments

  • ATimsonATimson Posts: 15 Bronze 1
    When we needed to solve this problem, we used semicolons in RGDM and then split the string into an array in our PowerShell script.

    That said: Deploy.ps1 will be run on each RGDM target server. So your example doesn't seem like it's the right way to solve your problem. :)
  • ATimson wrote:
    So your example doesn't seem like it's the right way to solve your problem. :)

    Yes. You are right. I did the fix yesterday pretty much like you described:

    - pass parameter as a string: server1, server2
    - in the Deploy.ps1:
    param([string]$WebSrvs = $WebServers)
    ...
    $WebSrvs.Split(",")| % {$_.Trim(" ","'","""")} | % { doStuff $_ }
Sign In or Register to comment.