NetApp Community Update
This site will enter Read Only mode on July 23 as we prepare to move to a new platform. You will still be able to view content, but posting and replying will be temporarily disabled.
We're excited to launch our new Community experience on July 30 and more information will follow soon.
Stay connected during the transition - Join our Discord community today.

Active IQ Unified Manager Discussions

[array] input parameters

francoisbnc
5,746 Views

I would like to use [array] type in commands, Is someone can explain how user inputs must be formatted for retrieve  string list in a foreach loop

Tried with   '@("table1","table2", "table3")'  without success.

francois

1 ACCEPTED SOLUTION

sharu
5,746 Views

Hi

You will need to mention the array elements without the @ symbol. So in your case, put AA,BB as input instead of '@("AA","BB")'

-Sharu

View solution in original post

4 REPLIES 4

sharu
5,746 Views

Hi Francois

Not sure if this is what you are looking for:

Please try using it like the below:

param (

  [parameter(Mandatory=$true, HelpMessage="abcd")]

  [array]$abcd

)

$arrayelemnet= $abcd[1]

-Sharu

francoisbnc
5,746 Views

Hi Sharu,

How is the syntax to pass [array]abcd parameter from Workflow user Inputs?

In my example:

param (

   [parameter(Mandatory=$true, HelpMessage="One or more license codes of a Data ONTAP service to be enabled.")]

  [array]$Codes

)

foreach ($Code in $Codes)

{

Get-WFALogger -Info -message $($Code)

}

sharu
5,747 Views

Hi

You will need to mention the array elements without the @ symbol. So in your case, put AA,BB as input instead of '@("AA","BB")'

-Sharu

francoisbnc
5,746 Views

Damn it seemed i tested this possibilty, that works but I have to remove parenthesis

Thank you

francois

Public