Hi,
I am experiencing something rather strange.
With this very simple example, the array I am passing as an argument seems to be considered as a string whatever quoting syntax I am using.
param(
[string[]]$Items
)
foreach ($item in $Items) {
Write-Host "Item: $item"
}
docker run --rm -v .:/tmp/scripts akamai/powershell pwsh -File /tmp/scripts/Test1.ps1 -Items 'a','b','c'
Item: a,b,c
But if I run the entrypoint without any argument, and then execute my script at interpreter level, everything is working as expected :
docker run -ti --rm -v .:/tmp/scripts akamai/powershell
PowerShell 7.5.0
PS /> /tmp/scripts/Test1.ps1 -Items 'a','b','c'
Item: a
Item: b
Item: c
I have tried with various PS images (builder, version), even a self-made one and the behavior is always the same.
I encountered issues with booleans too, but I was able to solve it by using a syntax like '-Varname:true".
But this time I have no clue …
What I am missing ?
Regards