I declared an array of tuples as follows:
[System.Tuple[string,string][]] $files = @()
And I have the following workflow:
Workflow Perform-Download
{
Param (
[Parameter(Mandatory = $true)]
[System.Tuple[string,string][]] $Files
)
ForEach -Parallel ($file in $Files)
{
Parallel{Save-File -Url $file.Item1 -DestinationFolder $file.Item2}
}
}
I'm trying to do the following:
Perform-Download -Files $files
But I get the following error:
Perform-Download : Cannot process argument transformation on parameter 'Files'. Cannot convert the
"System.Tuple`2[System.String,System.String][]" value of type "System.Tuple`2[[System.String, mscorlib, Version=4.0.0.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.String, mscorlib, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089]][]" to type "System.Tuple".
At line:1 char:26
+ Perform-Download -Files $files
+ ~~~~~~~
+ CategoryInfo : InvalidData: (:) [Perform-Download], ParameterBindingArgumentTransformationException
+ FullyQualifiedErrorId : ParameterArgumentTransformationError,Perform-Download
What am I doing wrong?