Hey,
this is because your CSV has a header - "Name"...Please try like this:
$compsPath = "C:\temp\comps.csv"
$comps = Import-Csv $compsPath
foreach ($comp in $comps.Name)
{
$remotePath = "\\$comp\c$\Users\Public\Desktop"
Get-ChildItem -Path $rmPath * -Include *.lnk -Recurse
}
Does it work like this? With me it did :)
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Regards,
Stoyan