When using YML arrays in a PowerShell step you need to convert it into a array by doing, as far as I know, something like this:
$requiredModules = "${{ join(';',parameters.requiredModules) }}" -split ';' | Where-Object { $_ }
- Join the array into a string with the pipeline
join function
- Split the now string into a PowerShell array
- Use
... | Where-Object { $_ } to get rid of any null values (added if passing in [])
Currently the output generated looks something like this:
$parameters.requiredModules -split ';' -replace '^[''"]' -replace '[''"]$'
When using YML arrays in a PowerShell step you need to convert it into a array by doing, as far as I know, something like this:
joinfunction... | Where-Object { $_ }to get rid of anynullvalues (added if passing in[])Currently the output generated looks something like this: