Having some issue using basic import-csv in a loop function.
I have basic csv file with hostname, node headers
I am assigning the file using import-csv
Then I am then simply starting
foreachloop when I am trying to test-path using the hostname within unc path\\$r.hostname\c$\users\something\desktopExpected result is true
But the actual result is false
when I am trying the actual hostname in the test-path instead of the csv param its working just fine.
$records = Import-Csv C:\Users\someuser\Desktop\partition-mapping.csv
foreach ($r in $records)
{
Test-Path -LiteralPath \\$r.hostname\c$\users <<====not working
Test-Path -LiteralPath \\hostname01.lab.local\C$\Users\ <<====== workign fine
}
as always you guys are awesome !!