Skip to content

Instantly share code, notes, and snippets.

@jimbrig
Last active August 24, 2022 13:00
Show Gist options
  • Save jimbrig/da88cb0d6ad1ff9037ce4e209728adfa to your computer and use it in GitHub Desktop.
Save jimbrig/da88cb0d6ad1ff9037ce4e209728adfa to your computer and use it in GitHub Desktop.
{"Checkpoint-Computer -description \"Restore point!\"": {"desc": "[PowerShell] Create new System Restore Point", "alias": "New-RestorePoint"}, "whoami /priv": {"desc": "[CMD] Check Current User's Priveledges", "alias": "Get-UserPriv"}, "(Get-Process | Sort-Object -Descending WS)[0]": {"desc": "[PowerShell] Get Process Consuming the most memory", "alias": "Get-MostMemoryProcess"}, "fsutil.exe fsinfo drives": {"desc": "[CMD] List all My Computer drives using fsutil", "alias": "Get-MyComputerDrives"}, "wmic startup list full": {"desc": "[CMD] Get list of startup programs with wmic", "alias": "Get-StartupPrograms"}, "autorunsc -m": {"desc": "[CMD] Show all startup entries, hiding Microsoft entries (requires SysInternals AutoRuns)", "alias": "Get-StartupProgramsNoMicro"}, "driverquery /FO list /v": {"desc": "[CMD] Enumerate list of drivers with complete path information.", "alias": "Get-DriverPaths"}, "netsh advfi fi sh rule name=all": {"desc": "[CMD] Obtain listing of all FireWall rules on local system", "alias": "Get-FireWallRules"}, "netsh wlan export profile key=clear folder=C:\\Users\\jimmy\\Desktop": {"desc": "[CMD] Export Wireless Connection Profiles to Desktop (displaying plain text passwords)", "alias": "Export-WirelessProfiles"}, "Add-Type -A System.IO.Compression.FileSystem;[IO.Compression.ZipFile]::ExtractToDirectory(\"<path to .zip>\", \"<path to destination>\")": {"desc": "[PowerShell] Unzip Compressed Zip File using Custom PowerShell Classes", "alias": "Template-Unzip"}, "forfiles /s /c \"cmd /c if @fsize gtr 100000 echo @path @fsize bytes\"": {"desc": "[CMD] Find Large Files from Working Directory", "alias": "Get-LargeFiles"}, "pnputil -e": {"desc": "[CMD] Enumerate Driver PAckages with their OEM .inf filenames", "alias": "Get-DriverInfs"}, "(New-Object -c Microsoft.Update.Session).CreateUpdateSearcher().Search(\"IsInstalled=0\").Updates|Select Title": {"desc": "[PowerShell] List Missing Windows Updates", "alias": "Get-MissingUpdates"}, "reg.exe ADD HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\policies\\system /v EnableLUA /t REG_DWORD /d 0 /f": {"desc": "[CMD] Disable UAC via CMD and Registry", "alias": "Disale-UAC"}, "netsh advfirewall set allprofiles state off": {"desc": "[CMD] Disable Firewall for all Profiles via netsh", "alias": "Disable-FireWall"}, "winsat cpuformal -v": {"desc": "[CMD] Run Windows Assessment Tool for CPU via winsat", "alias": "Invoke-WinSATCPU"}, "winsat memformal -v": {"desc": "[CMD] Run Windows Assessment Tool for Memory / RAM via winsat", "alias": "Invoke-WinSATRAM"}, "winsat diskformal -v": {"desc": "[CMD] Run Windows Assessment Tool for Disk via winsat", "alias": "Invoke-WinSATDisk"}, "& \"$env:ProgramFiles\\Windows Defender\\MpCmdRun.exe\" -scan -scantype 2": {"desc": "[CMD] Perform Full Defender System Scan using MpCmdRun", "alias": "Invoke-DefenderScanFull"}, "for /f \"tokens=2 delims=[]\" %a in ('ping -n 1 -4 \"%computername%\"') do @echo %a": {"desc": "[CMD] Retrieve standalone IPv4 IP Address using command prompt.", "alias": "Get-IPv4"}, "(get-process | ? { $_.mainwindowtitle } )": {"desc": "Get-WindowTitles", "alias": "Get-WindowTitles"}, "(get-process | ? { $_.mainwindowtitle -ne \"\" -and $_.processname -ne \"WindowsTerminal\" } )| stop-process": {"desc": "Close all currently opened windows and stop the process; except for the terminal.", "alias": "Close-All"}, "sudo update-alternatives --install /usr/bin/x-www-browser x-www-browser /mnt/c/users/jimmy/appdata/local/microsoft/edge\\ sxs/application/msedge.exe 1": {"desc": "[Linux] Set default browser in WSL to use host machine's Edge Canary installation", "alias": ""}, "netsh wlan show interfaces": {"desc": "Show network interfaces using netsh", "alias": ""}, "Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))": {"desc": "Install Chocolatey", "alias": "install-chocolatey"}, "iwr -useb 'https://raw.githubusercontent.com/scoopinstaller/install/master/install.ps1' | iex": {"desc": "Install Scoop", "alias": "install-scoop"}, "iex \"& { $(irm https://aka.ms/install-powershell.ps1) } -UseMSI\"": {"desc": "Install PowerShell Core", "alias": "install-powershell-core"}, "cinst git -y --package-parameters=\"'/GitAndUnixToolsOnPath /WindowsTerminal'\"": {"desc": "Install git via chocolatey with parameters", "alias": "install-git-with-params"}, "Get-AppxPackage -allusers | foreach {Add-AppxPackage -register \"$($_.InstallLocation)\\appxmanifest.xml\" -DisableDevelopmentMode}": {"desc": "Reset all store apps", "alias": "reset-store-apps"}, "npm i npm@latest -g": {"desc": "Update NPM", "alias": "update-npm"}, "python -m pip install --upgrade pip": {"desc": "Update PIP", "alias": "updatepip"}, "dism /online /get-drivers /format:table": {"desc": "List all windows drivers formatted as a table.", "alias": "view-drivers"}, "dir env:": {"desc": "Display all environment variables", "alias": "view-envvars"}, "Get-WindowsCapability -Online | Where-Object { $_.State -eq 'Installed' }": {"desc": "Get All Installed Optional Features on Windows Machine.", "alias": "getfeatures"}, "docker context create aci acr --location \"eastus\" --resource-group \"shinyapps\" --subscription-id \"14979b2f-bf56-4e0a-8a2e-1069ae5e79b9\"": {"desc": "Setup Docker Context for Azure Container Registry", "alias": "setupdockeracr"}, "explorer.exe shell:AppsFolder": {"desc": "Open all apps shell folder in explorer.", "alias": "allapps"}, "sfc /scannow": {"desc": "sfc scannow", "alias": "sfc"}, "chkdsk C: /f /r /x": {"desc": "checkdisk", "alias": "checkdisk"}, "wsreset.exe": {"desc": "Reset Windows Store", "alias": "resetstore"}, "docker login docker.pkg.github.com": {"desc": "Login to GitHub Container Registry via Docker ", "alias": "dockergh"}, "Get-AppxPackage -PackageTypeFilter Main | ? { $_.SignatureKind -eq \"System\" } | Sort Name | Format-Table Name, InstallLocation": {"desc": "View all System AppX Packages.", "alias": "getsysapps"}, "Get-AppxProvisionedPackage -Online | Format-Table DisplayName, PackageName": {"desc": "Get all provisioned apps; Provisioned: Installed in user account the first time you sign in with a new user account.", "alias": "getappx-provisioned"}, "cat \"GodMode.{ED7BA470-8E54-465E-825C-99712043E01C}\"": {"desc": "print godmode", "alias": "godmode"}, "Get-AppxPackage -AllUsers *paint* | Reset-AppxPackage": {"desc": "Reset a Store app (MSPaint in this example)", "alias": "resetpaint"}, "psql postgres://postgres:2G8qkzEFpPOqw06N@34.93.37.61:5432/powwater": {"desc": "Connect to POWWATER development localhost database.", "alias": "powdb"}, "pip3 --no-cache-dir install -U keep==2.10.1": {"desc": "Update keep", "alias": "updatekeep"}, "github-gists jimbrig -t e1ecc70eb6ce625a2ca4c3ddaa05e62bef394e9e >> \"2020-02-23-GH-Gists.md\"": {"desc": "Download github gists to markdown", "alias": "getgists"}, "winSAT formal -restart": {"desc": "Run 'winSAT' diagnostics", "alias": "winsat"}, "wmic useraccount get domain,name,sid": {"desc": "List User Account Profiles, Domains, and SIDs", "alias": "lsusers"}, "\"%ProgramFiles%\\Windows Defender\\MpCmdRun.exe\" -Scan -ScanType 1": {"desc": "virusscan", "alias": "scan"}, "cmd.exe \"%ProgramFiles%\\Windows Defender\\MpCmdRun.exe\" -Scan -ScanType 1": {"desc": "virusscan", "alias": "scan"}, "winupdatereset": {"desc": "Reset Windows Update Components", "alias": "resetwinup"}, "net stop bits": {"desc": "Stop BITS", "alias": "stopbits"}, "net stop wuauserv": {"desc": "Stop windows update server", "alias": "stop wserv"}, "net stop appidsvc": {"desc": "Stop the appidsvc service", "alias": "stop appid"}, "net stop cryptsvc": {"desc": "Stop cryptographic service", "alias": "stopcrypto"}, "Ipconfig /flushdns": {"desc": "Flush DNS with ipconfig", "alias": "flushdns"}, "del /s /q /f \"%ALLUSERSPROFILE%\\Application Data\\Microsoft\\Network\\Downloader\\qmgr*.dat\" ": {"desc": "Delete network data", "alias": "delnetqm"}, "del /s /q /f \"%SYSTEMROOT%\\Logs\\WindowsUpdate\\*\"": {"desc": "Delete windows update files", "alias": "delwinup"}, "Repair-WindowsImage -Online -ScanHealth": {"desc": "Scan Windows Image with Powershell cmdlet", "alias": "scanwinimg"}, "Dism /Online /Cleanup-Image /ScanHealth": {"desc": "Scan Windows Image with CMD DISM", "alias": "dismscan"}, "Repair-WindowsImage -Online -RestoreHealth": {"desc": "Repair Windows Image with Powershell cmdlet", "alias": "repairwinimg"}, "Dism /Online /Cleanup-Image /RestoreHealth": {"desc": "DISM online repair image", "alias": "dismrepair"}, "Dism.exe /online /Cleanup-Image /StartComponentCleanup": {"desc": "DISM component cleanup", "alias": "dismcleanup"}, "mdsched.exe": {"desc": "Windows Memory Diagnostic", "alias": "testmemory"}, "reg export HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Applets\\Regedit\\Favorites registry-favorites.reg": {"desc": "Export Saved Registry Favorites", "alias": "exportregfavs"}, "C:\\ProgramData\\chocolatey\\lib\\cloneapp\\tools\\CloneApp.exe /CB \"C:\\Users\\jimbr\\OneDrive\\2-Areas\\System\\Backup\\CloneApp\"": {"desc": "Backup all apps via CloneApp", "alias": "cloneapps"}, "curl.exe -A \"MS\" https://webinstall.dev/webi | powershell": {"desc": "Install webi a script installer solution", "alias": "instwebi"}, "Set-ItemProperty 'HKLM:\\SYSTEM\\CurrentControlSet\\Control\\FileSystem' -Name 'LongPathsEnabled' -Value 1": {"desc": "Enable long path support in registry", "alias": "enablelongpaths"}, "cat /mnt/c/users/admin/.docker/github_cr_pat | docker login ghcr.io -u jimbrig --password-stdin": {"desc": "Login to GHCR with Docker for WSL/Linux", "alias": "ghcrwsl"}, "netsh wlan show wlanreport": {"desc": "Create a Network Performance Windows Report", "alias": "netreport"}, "cmd.exe /c Cleanmgr /sageset:65535 & Cleanmgr /sagerun:65535": {"desc": "Extended Disk Cleanup", "alias": "deepclean"}, "netsh wlan show profile name=fossbytes key=clear": {"desc": "Wifi Passwords", "alias": "wifi-details"}, "Get-CimInstance Win32_WinSat": {"desc": "Run WinSAT Diagnostics Score", "alias": "winsat"}, "msdt.exe -id DeviceDiagnostic": {"desc": "Hardware Diagnostic Troubleshooter", "alias": "devicediagnostic"}, "Install-fromURL \"https://wureset.com/files/installers/wureset11009_setup_winx64.exe\" \"ResetWU\"": {"desc": "Install windows update reset tool", "alias": "install-wureset"}, "start-mpscan -scantype fullscan": {"desc": "Start Defender Virus Scan (Full)", "alias": "virusscan"}, "wmic diskdrive list brief": {"desc": "View available disks on Windows", "alias": "diskdrivebrief"}, "iwr -useb https://raw.githubusercontent.com/filebrowser/get/master/get.ps1 | iex": {"desc": "Install File Browser", "alias": "install-filebrowser"}, "msiexec.exe /i https://awscli.amazonaws.com/AWSCLIV2.msi": {"desc": "Install Amazon AWS-CLI (v2)", "alias": "install-aws-cli"}, "$ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest -Uri https://aka.ms/installazurecliwindows -OutFile .\\AzureCLI.msi; Start-Process msiexec.exe -Wait -ArgumentList '/I AzureCLI.msi /quiet'; rm .\\AzureCLI.msi": {"desc": "Install Azure CLI", "alias": "install-azcli"}, "sh -c \"$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)\"": {"desc": "Install oh-my-zsh (bash)", "alias": "install-ohmyzsh"}, "lastversion \"PowerShell/PowerShell\" --assets --filter \"win-x64*.msi\" -d \"$HOME\\Downloads\\PowerShell-Stable.msi\"": {"desc": "Download PowerShell (Stable)", "alias": "download-pwsh"}, "lastversion \"PowerShell/PowerShell\" --pre --assets --filter \"win-x64*.msi\" -d \"$HOME\\Downloads\\PowerShell-Stable.msi\"": {"desc": "Download PowerShell (Preview)", "alias": "download-pwsh-pre"}, "gh release download -R \"AutomatedLab/AutomatedLab\" --pattern \"*msi\" -D \"$HOME\\Downloads\\\"": {"desc": "Example GH-CLI Release Download", "alias": "gh-download-release"}, "cmdkey.exe /list": {"desc": "List all saved secrets in Windows Credential Manager", "alias": "Get-WinCredKeys"}, "(Invoke-WebRequest -uri \"https://api.ipify.org/\").Content": {"desc": "Get Local IP ipv4 Address", "alias": "Get-IP"}, "pip freeze | %{$_.split('==')[0]} | %{pip install --upgrade $_}": {"desc": "Upgrade all pip packages", "alias": "upgradepip"}, "/bin/bash -c \"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)\"": {"desc": "Install Homebrew (BASH)", "alias": "install-brew"}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment