Foreach loop with import-csv
<p>Having some issue using basic import-csv in a loop function.</p>

<ol>
<li><p>I have basic csv file with hostname, node headers </p></li>
<li><p>I am assigning the file using import-csv </p></li>
<li><p>Then I am then simply starting <code>foreach</code> loop when I am trying to test-path using the hostname within unc path <code>\\$r.hostname\c$\users\something\desktop</code></p></li>
<li><p>Expected result is true </p></li>
<li><p>But the actual result is false </p></li>
</ol>

<p>when I am trying the actual hostname in the test-path instead of the csv param its working just fine. </p>

<pre><code>$records = Import-Csv C:\Users\someuser\Desktop\partition-mapping.csv

foreach ($r in $records)
{

    Test-Path -LiteralPath \\$r.hostname\c$\users   &lt;&lt;====not working 

    Test-Path -LiteralPath \\hostname01.lab.local\C$\Users\ &lt;&lt;====== workign fine



}
</code></pre>

<p>as always you guys are awesome !!</p>