D B
asked on
PowerShell Function Not Working as Expected
I have the following function:
function GetParameterValue($ParmFile, $ParmName)
{
$tmp = $ParmFile | where { $_.Key -eq $ParmName } | Select Value
return $tmp.value
}
$ParmFile is created outside the function with the following code:$CSV = import-csv .\Params.csv
$CSV is what is passed to the function. The call syntax is $ROOT = GetParameterValue($CSV, "ROOT")
This is returning an empty string. I know I am reading the data into $CSV because prior code was replicating what I encapsulated into the function and working properly. Is there something I am missing here?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER