Last active
January 5, 2016 18:12
-
-
Save PCfromDCSnippets/a13dc87d68e493d8794a to your computer and use it in GitHub Desktop.
Get Database Information
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#region Get Database Info | |
$query1 = "SELECT name, physical_name AS CurrentLocation, state_desc | |
FROM sys.master_files | |
WHERE database_id = DB_ID(N'" + $dbName + "');" | |
Write-Verbose "Getting [$dbName] information..." -Verbose | |
$items = Invoke-Sqlcmd -Query $query1 | |
Write-Output $items | |
#endregion |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment