Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Solved! See The Solution
1 ACCEPTED SOLUTION
migration has accepted the solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
4 REPLIES 4
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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)
}
migration has accepted the solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Damn it seemed i tested this possibilty, that works but I have to remove parenthesis
Thank you
francois
