dbatools is a free PowerShell module with over 300 SQL Server administration, best practice and migration commands included.

Please note that documentation and command names may be out of date while we work furiously towards 1.0


This command will shows a treeview populated by directories enumerated by SQL Management Objects (SMO) EnumDirectories() and EnumAvailableMedia(). This, essentially, is a window to the one you’re presented by in SSMS. Once you select a path, a string of that path will be returned.

All files shown are only files that you have permission to see, as granted by SQL Server itself. We use this command internally in dbatools, but wanted to share it with you in the event you’d like to include it in your own scripts.


To show a GUI that logs into a server Windows Authentication. Returns a string of the path you selected.

Shows a GUI and uses SQL credentials to log into the SQL Server. Returns a string of the path you selected.




From PowerShell, execute Get-Help Show-DbaServerFileSystem -Detailed for more information on this function.

Source Code

Want to see the source code? View Show-DbaServerFileSystem.ps1 on GitHub

Related commands