I misposted this topic in the SQL Server development forum before I knew this forum existed.
I have developed a powershell script to install databases and database objects (procedures, functions, etc). The script allows the user to pass in a directory and request that the database be created at that location. What I want to do is validate that the user has permissions to create the database at that location. I have checks that validate the passed location is a directory, but I can not figure out to validate that SQL Server is allowed to created the database files in the requested file system location.