Where am I going wrong with foreach when i try to get my script to run against each individual string in my results?
The problem seems to be related to this line of code:
$ProjectName = $finduser -split ",", 3 | Select-Object -Index 1
During each iteration, you are using $FindUser
instead of $Object
. You should change it to:
$ProjectName = $Object -split ",", 3 | Select-Object -Index 1