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
#!/usr/bin/env pwsh | |
<# | |
.SYNOPSIS | |
Script to adjust Xinput mouse settings. Designed for using around event-based triggers, such as xbindkeys. | |
.DESCRIPTION | |
Changes certain Xinput mouse settings. Currently only supports adjusting the mouse speed. Leans on the `xinput` | |
command to read and apply Xinput configurations. A high-level explanation of which settings are changed for | |
each operation can be found further on in the description. | |
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
function Invoke-Executable { | |
[CmdletBinding()] | |
Param( | |
[Parameter(Mandatory, Position=0)] | |
[string]$Command, | |
[Parameter(Position=1, ValueFromRemainingArguments)] | |
[string[]]$Arguments, | |
[int[]]$ExitCode = 0 | |
) |
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
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 | |
) |
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
#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 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 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 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 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 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 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 |
NewerOlder