I have a problem that I do not understand. I am having a function that looks:
Function hashTable
{
Param($release)
$releaseArray = @()
if (![string]::IsNullOrWhitespace($release))
{
$releaseArray = $release.split("{|}", [System.StringSplitOptions]::RemoveEmptyEntries)
$releaseArray.gettype() | Select-Object Name
if($releaseArray.Count -gt 0) {
$namePathArray = @{}
foreach($namePath in $releaseArray) {
$splitReleaseArray = $namePath.split("{,}", [System.StringSplitOptions]::RemoveEmptyEntries)
$namePathArray.add($splitReleaseArray[0], $splitReleaseArray[1])
}
#here it echos propper hashtable
$namePathArray.gettype() | Select-Object Name
if($namePathArray.Count -gt 0) {
#here it echos propper hashtable as well
return $namePathArray
}
}
}
}
but when I call this function im getting an array not a hashtable that looks like:
Name
----
String[]
test
reorder
example input param: -release "reorder,c:\Repo\App|test,test"
And I am wondering if I'm missing something?
$releaseArray.gettype() | Select-Object Nameand$namePathArray.gettype() | Select-Object Namein your code supposed to do?