powershell - Testing if a directory is browseable -
powershell - Testing if a directory is browseable -
i mounting backup images captured via shadowprotect explorer mountpoints. initial test file exist on drive via test-file in powershell. if true, can assume backup image mounted , "good".
my issue comes systemreserved partitions have no files can test existence. there function in powershell (or net?) can test if directory can browsed (as opposed looking file?). or other ideas accomplish similar thing?
thanks!
note: images read-only.
$mypath = \\backupserver\share\folder\ $canread = $true seek { get-childitem $mypath -erroraction stop | out-null } grab [system.exception] { #could more specific on type of error here, i'm guessing errors suggest issue equivelant read permissions issue. $canread = $false } if($canread) { ":)" } else { ":(" }
powershell
Comments
Post a Comment