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

Powershell 2 and AlphaFS.dll - looking for the script to continue on exception instead of exiting.

$
0
0

Looking for a way to continue on exception - script exits when "Access Denied" to a folder exception takes place

Using Alphaleonis library to get long paths (above 260 character limit). This script runs until it encounters "Access Denied" on the folder. Can someone help me get this script to actually continue to the next folder instead of exiting. 


[Reflection.Assembly]::LoadFile("C:\AlphaFS\AlphaFS.dll")

$Path = "D:\"

$Folders = [Alphaleonis.Win32.Filesystem.Directory]::GetDirectories($Path,"*","AllDirectories")

Foreach ($Folder in $Folders) { $Folder } 


Viewing all articles
Browse latest Browse all 6937

Trending Articles