So you want to determine if a folder or file exists with PowerShell? You can invoke the same scripting object you might remember from VB.... #set a var for the folder you are looking for $folderPath = 'C:\Temp\' #instantiate the FileSystemObject $objFSO = New-Object -ComObject Scripting.FileSystemObject #check to see if it is missing if($objFSO.FileExists($fold... -eq $FALSE)) { echo "The folder does not exist." exit } else { echo "The folder exists." exit } ......
I gotta admit, I really like PowerShell. No, that's not accurate. I love PowerShell. I love PowerShell like babyback ribs love sauce. My relationships with PowerShell has bloomed from piqued interest to full blown infatuation. PowerShell fits the bill of what I look for with tools - not overly engineered, actually useful, lightweight and extensible. But since I have taken such a liking to PowerShell, that makes me wonder...isn't PowerShell supposed to be designed for admins who aren't programmers? ......