Skip to content

Instantly share code, notes, and snippets.

@bigbadmoshe
bigbadmoshe / ASCIIART.md
Last active July 18, 2024 07:57
PowerShell Snippets

ASCIIART

$ASCIIART = "ICAgICAgICAgICAgICAgICAgIExPQURJTkcuLi4gICAgICAgICAgICAgICAgICAK4pWU4pWQ4pWQ4pWQ4pWQ4pWQ4pWQ4pWQ4pWQ4pWQ4pWQ4pWQ4pWQ4pWQ4pWQ4pWQ4pWQ4pWQ4pWQ4pWQ4pWQ4pWQ4pWQ4pWQ4pWQ4pWQ4pWQ4pWQ4pWQ4pWQ4pWQ4pWQ4pWQ4pWQ4pWQ4pWQ4pWQ4pWQ4pWQ4pWQ4pWQ4pWQ4pWQ4pWQ4pWQ4pWQ4pWQ4pWXCuKVkSAwJSDilojilojilojilojilojilojilojilojilojilojilojilojilojilojilojilojilojilojilojilojilojilojilojilojilojilojilojilojilojilojilojilojilojilojilojiloggMTAwJSDilZEgCuKVmuKVkOKVkOKVkOKVkOKVkOKVkOKVkOKVkOKVkOKVkOKVkOKVkOKVkOKVkOKVkOKVkOKVkOKVkOKVkOKVkOKVkOKVkOKVkOKVkOKVkOKVkOKVkOKVkOKVkOKVkOKVkOKVkOKVkOKVkOKVkOKVkOKVkOKVkOKVkOKVkOKVkOKVkOKVkOKVkOKVkOKVkOKVnQogICAgICAgICAgICAgICAgICAgQ09NUExFVEVEISAg"
<#
Set-ExecutionPolicy Bypass -Scope LocalMachine -Force
iwr https://gist.githubusercontent.com/radtkedev/d8c4121931633eca04ca625d09ff1a11/raw/Windows-11-Setup.ps1 -OutFile C:\setup.ps1
& C:\setup.ps1
#>
if (!(New-Object Security.Principal.WindowsPrincipal([Security.Principal.WindowsIdentity]::GetCurrent())).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
Start-Process -FilePath "powershell.exe" -ArgumentList ("-File", $MyInvocation.MyCommand.Source, $args | %{ $_ }) -Verb RunAs; exit
}
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
# Various PowerShell Snippets
@SMSAgentSoftware
SMSAgentSoftware / Get-CurrentPatchInfo.ps1
Last active February 23, 2024 20:58
Gets the current software update level of a Windows 10/11 workstation and compares with the latest available updates. Can also list all available updates for the current build.
[CmdletBinding()]
Param(
[switch]$ListAllAvailable,
[switch]$ExcludePreview,
[switch]$ExcludeOutofBand
)
$ProgressPreference = 'SilentlyContinue'
Function Get-MyWindowsVersion {
[CmdletBinding()]
@ninmonkey
ninmonkey / A cheat sheet - VS Code, Wt, etc config file locations.md
Last active July 13, 2022 08:19
cheat sheet - VS Code, Wt, etc config files

Windows 10

App Note Path
VS Code Global config $Env:APPDATA\Code\User\Settings.json
VS Code - Insiders Global config $Env:APPDATA\Code - Insiders\User\Settings.json
VS Code Extensions Dir $env:UserProfile\.vscode\extensions
Wt Preview see Get-WindowsTerminalProfile.ps1 $env:LOCALAPPDATA\Packages\Microsoft.WindowsTerminalPreview_8wekyb3d8bbwe\LocalState\settings.json
@MVKozlov
MVKozlov / Show-MessageBox.ps1
Last active June 1, 2023 14:15
Powershell: Show GUI Messagebox and wait for user input or timeout
<#
.SYNOPSIS
Show GUI Messagebox
.DESCRIPTION
Show GUI Messagebox and wait for user input or timeout
.PARAMETER Message
Message to show
.PARAMETER Title
Messagebox title
.PARAMETER Buttons
@desbest
desbest / Reset-WindowsUpdate.ps1
Last active February 18, 2024 17:03
Reset Windows Update Client Settings Script
<#
.SYNOPSIS
Reset-WindowsUpdate.ps1 - Resets the Windows Update components
.DESCRIPTION
This script will reset all of the Windows Updates components to DEFAULT SETTINGS.
.OUTPUTS
Results are printed to the console. Future releases will support outputting to a log file.
@gwblok
gwblok / GetMachineDatabase-WithPrompts-FromCM.ps1
Last active April 16, 2021 07:47
Dynamically create Collections based on your Hardware Inventory in CM
<#V2020.01.27
Updated Script to Create "Operational" Folder and then move newly created Collections there.
Borrowed Code from Benoit Lecours
Made script pull addtional info dynamic, you shouldn't have to make any environmental chanages for script to work.
Script now also creates an "All Workstation" Collection and uses that as the limiting collection, unless one with that name already exist, then uses that.
Change the Limiting Collection info by updating: $LimitingCollection
You can easily modify the Collection Prefix now by changing these below:
$ModelColPrefix = "ModelCol"
$ManufacturerColPreFix = "ManufacturerCol"
@echo off
Title Converter Office 2016 Retail to Volume
echo Press Enter to start VL-Conversion...
echo.
pause
echo.
for /f "tokens=6 delims=[]. " %%G in ('ver') do set win=%%G
@rkeithhill
rkeithhill / settings.json
Last active November 21, 2020 22:39
Windows Terminal home profile
// This file was initially generated by Windows Terminal 0.11.1121.0
// It should still be usable in newer versions, but newer versions might have additional
// settings, help text, or changes that you will not see unless you clear this file
// and let us generate a new one for you.
// To view the default settings, hold "alt" while clicking on the "Settings" button.
// For documentation on these settings, see: https://aka.ms/terminal-documentation
{
"$schema": "https://aka.ms/terminal-profiles-schema",