Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

Read UNC Shares from file, verify directory exists and output CASE SENSITIVE true path

$
0
0

I'm looking for a script that will verify if a directory exists by parsing through a text file of UNC shares. I want it to write the case sensitive UNC path to the output file (.csv). The original file may not be case sensitive, but the output file needs to be exactly how the path exists on the share.

This is what I have so far, but it only copies the path from the text file and writes it to the csv after verifying the path exists.

Get-Content'c:\users\bleblanc\110714_CleanList.txt' `

  | select @{n='Path';e={$_}}, @{n='Exists';e={Test-Path $_}} `

 

  | Export-Csv'c:\users\mytech\11.07.14_Results_Thursday11.13.14.csv' -NoType

 

Ultimately, we turn this over to another group who runs a linux script that will ignore paths that do not match the exact case sensitive paths we supply them.


Viewing all articles
Browse latest Browse all 6937

Trending Articles