This file contains hidden or 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
| <# | |
| .Description | |
| Execute SQL command without using the SQLServer PowerShell Module. Restriced to using windows auth in this version. | |
| .Example | |
| If expecting a result set returned: | |
| Invoke-SqlCmdNoModule -ServerInstance '' -Database '' -Query '' | |
| If not expecting a result set returned: | |
| Invoke-SqlCmdNoModule -ServerInstance '' -Database '' -Query '' -NonQuery |
This file contains hidden or 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
| <# | |
| .DESCRIPTION | |
| Run SQL job and wait for it to complete | |
| .EXAMPLE | |
| script/function -SqlInstance "whatver" -JobName "whatever" | |
| #> | |
| Invoke-SqlJob | |
| { | |
| [CmdletBinding()] | |
| param ( |
This file contains hidden or 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
| <# | |
| .SYNOPSIS | |
| Prevent current Windows user session from going idle. | |
| .DESCRIPTION | |
| Prevent current Windows user session from going idle by calling [System.Windows.Forms.SendKey]::SendWait('') method every 30 seconds within a background job. | |
| .EXAMPLE | |
| PS> Block-Sleep | Out-Null | |
| Calls the Block-Sleep function with default parameter values, and Out-Null prevents output to console if not desired. | |
| Add function and call to function in PS profile to block sleep when PowerShell window is open. | |
| .NOTES |