Created
November 30, 2014 12:40
-
-
Save martin9700/978a5a0a5861127be4f7 to your computer and use it in GitHub Desktop.
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
Begin { | |
If ($ListDatabases) | |
{ $Database = "Master" | |
$Query = "Select Name,state_desc as [State],recovery_model_desc as [Recovery Model] From Sys.Databases" | |
} | |
If (-not $Query) | |
{ $Path = Join-Path -Path $env:TEMP -ChildPath "Invoke-SQLQuery-Query.txt" | |
Start-Process Notepad.exe -ArgumentList $Path -Wait | |
$Query = Get-Content $Path | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment