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 | |
| PowerShell script to validate the served Terminal Services (RDP) | |
| certificate on a Windows Server is valid. | |
| .DESCRIPTION | |
| This script checks the validation of the served Terminal Services certificate | |
| on one or more Windows Servers, and returns an array of PSCustomObjects summarizing the | |
| validation state of the TS certificate of each server. | |
| If the Terminal Services certificate is self-signed or signed by an internal/private CA, |
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
| [CmdletBinding()] | |
| Param() | |
| Add-Type -AssemblyName System.Windows.Forms | |
| Function WaitForKey { | |
| Write-Host 'Press any key to continue...' | |
| [void]$host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown") | |
| } | |
| $MAX_MINS = 1440 # Max time in minutes this script can execute |
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 | |
| Configures a secure WinRM listener over HTTPS to enable | |
| SSL-based WinRM communications. This script has not been | |
| tested on Windows Server 2003R2 or earier, and may not | |
| work on these OSes for a variety of reasons. | |
| If Windows Remote Management is disabled (e.g. service | |
| stopped, GPO Policy, etc.), this script will likely fail. | |
| .DESCRIPTION |
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 precmd { | |
| local TERMWIDTH | |
| (( TERMWIDTH = ${COLUMNS} - 1 )) | |
| ### | |
| # Truncate the path if it's too long. | |
| PR_FILLBAR="" |
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
| # DISCLAIMER - This is provided as a method to interface with HTTPS endpoints configured | |
| # with an invalid certificate as is common during the development process. This is not | |
| # intended or recommended to be used in a production scenario for obvious security reasons. | |
| # | |
| # Also, I did not write the C# code. Props to kd0shk and the Powershell subreddit for the C# snippet. | |
| # Both of these approaches won't work in PowerShell core and is not required as built-in | |
| # request cmdlets now have the -SkipCertificateCheck parameter | |
| # (e.g. Invoke-WebRequest -SkipCertificateCheck https://server.withbadcert.domain.tld) |
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
| Add-Type -AssemblyName System.Speech | |
| $SpeechSynth = New-Object System.Speech.Synthesis.SpeechSynthesizer | |
| $SpeechSynth.SelectVoice( 'Microsoft Zira Desktop' ) | |
| $CatFact = Invoke-RestMethod -UseBasicParsing https://catfact.ninja/fact | |
| $SpeechSynth.speak( "Did you know? $($CatFact.fact)" ) |
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
| {"lastUpload":"2020-08-21T16:12:30.636Z","extensionVersion":"v3.4.3"} |
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-ChocolateyOutdatedPackages { | |
| <# | |
| .SYNOPSIS | |
| Gets outdated Chocolatey packages on the local system | |
| .DESCRIPTION | |
| Returns an array of objects with the following properties: | |
| - PackageName: [string] Name of the Chocolatey package. | |
| - CurrentVersion: [string] Current version of the Chocolatey package. |
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 6.2 | |
| function Get-CanWriteDirectory { | |
| [CmdletBinding()] | |
| Param( | |
| [Parameter(Mandatory, Position=0)] | |
| [ValidateScript( | |
| { Test-Path -PathType Container $_ }, | |
| # Remove this property to make compatible with 5.1, 6.0, and 6.1 | |
| ErrorMessage = "Could not find the path or it is not a directory: {0}" |
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-CanWriteDirectory { | |
| [CmdletBinding()] | |
| Param( | |
| [Parameter(Mandatory, Position=0)] | |
| [ValidateScript( | |
| { Test-Path -PathType Container $_ }, | |
| ErrorMessage = "Could not find the path or it is not a directory: {0}" | |
| )] | |
| [string]$Path | |
| ) |