Automation Account for Powershell7.1 Does not support array input in Web

Lars Kartevoll 21 Reputation points
2023-03-10T13:55:20.4433333+00:00

When inputting an array in Web-Azure. The array is not parsed as expected:

Runbook code:

param(
    [System.String[]]$TestParameter
)

foreach($Entry in $TestParameter){
    $Entry
}

Input when starting runbook:
["does", "This", "even", "work"]

Output from runbook:

[does
this
even
work]

This works fine in PowerShell 5.1 :/

Azure Automation
Azure Automation
An Azure service that is used to automate, configure, and install updates across hybrid environments.
1,257 questions
{count} votes

1 answer

Sort by: Most helpful
  1. tbgangav-MSFT 10,416 Reputation points
    2023-04-19T17:42:14.64+00:00

    Hi @Lars Kartevoll , <<Re-posting as answer for better reach and to help other community members who might be looking for similar answer.>> It works by giving parameter as string[]. For illustration, check below screenshot. User's image

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.