March 8th, 2015

PowerTip: Find if Folder Exists

Doctor Scripto
Scripter

Summary: Use Windows PowerShell to see if a folder exists.

Hey, Scripting Guy! Question How can I easily find if a folder exists for a Windows PowerShell script that I am writing?

Hey, Scripting Guy! Answer Use the Test-Path cmdlet and the PathType parameter, for example:

Test-Path c:\fso -PathType Container

Author

The "Scripting Guys" is a historical title passed from scripter to scripter. The current revision has morphed into our good friend Doctor Scripto who has been with us since the very beginning.

0 comments

Discussion are closed.