Hey Scripting Guy,
How do I pass a pipeline variable to another function?
Example:
I have a .csv file with a list of users First and Last name. I need to get the users sAMAccountName and pass it to another function.
Here is my code:
$intakelist = Get-Content c:\userlist.csv
foreach($name in $intakelist){
Get-QADuser $name -searchroot $search -SearchScopt subtree -IncludedProperties sAMAccountName | .\get-someotherfunctioin.ps1 $_
}
When I try this code it calls the get-someotherfunction with an empty variable.