I need to verify one path using powershell. The problem is when given the path like Test-Path -Path "\\\10.2.200.13\share\Logger\Logger" its working fine, but my requirement is that, this path will be available in a Notepad - we need to read the path from the notepad then verify it. Here is the code:
$var = ( Get-Content D:\TestPathIssue\Params.txt ) -split '='
$source1=$var[1].Trim();
test-path -Path $source1;
I am able to get path in $source1 but I don't understand why its failing in Test-Path in this approach.
Notepaddo you really mean you need to get the path from a file?