Skip to content

Instantly share code, notes, and snippets.

@eplord
eplord / DriveClean.ps1
Created March 5, 2025 10:31 — forked from pmsmith/DriveClean.ps1
Simple script to clear temp files and Google Chrome cache/history
#------------------------------------------------------------------#
#- Clear-WindowsUserCacheFiles #
#------------------------------------------------------------------#
Function Clear-WindowsUserCacheFiles {
param([string]$user=$env:USERNAME)
Remove-CacheFiles "C:\Users\$user\AppData\Local\Temp"
Remove-CacheFiles "C:\Users\$user\AppData\Local\Microsoft\Windows\WER"
Remove-CacheFiles "C:\Users\$user\AppData\Local\Microsoft\Windows\Temporary Internet Files"
}
@eplord
eplord / DriveClean.ps1
Created March 5, 2025 10:31 — forked from mark05e/DriveClean.ps1
Simple script to clear temp files and browser cache/history
#------------------------------------------------------------------#
#- Clear-GlobalWindowsCache #
#------------------------------------------------------------------#
Function Clear-GlobalWindowsCache {
Remove-CacheFiles 'C:\Windows\Temp'
Remove-CacheFiles "C:\`$Recycle.Bin"
Remove-CacheFiles "C:\Windows\Prefetch"
C:\Windows\System32\rundll32.exe InetCpl.cpl, ClearMyTracksByProcess 255
C:\Windows\System32\rundll32.exe InetCpl.cpl, ClearMyTracksByProcess 4351
}
####################################################################################################
# BOOTSTRAP #
####################################################################################################
# Run script as Administrator if the session isn't elevated
if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]"Administrator")) {
$ArgumentList = "-NoExit -NoProfile -ExecutionPolicy Bypass -File `"$PSCommandPath`""
Start-Process -FilePath "powershell.exe" -ArgumentList "$ArgumentList" -Verb RunAs
Exit
}
@eplord
eplord / ws_setup.ps1
Created March 2, 2025 08:29 — forked from techthoughts2/ws_setup.ps1
This PowerShell script will setup a fresh workstation with everything needed to sucessfully work and be a DevOps Master day-to-day.
#region installs
# core tech choco installs
$script:chocoCoreTech = @(
# 'vscode' # visual studio code
# 'python' # python
# '7zip' # file archiver with good compression ratio
# 'git' # git for windows
# 'firefox' # firefox browser
)

Machine setup scripts

Idempotent scripts I use to set up my machines.

Windows

iwr -useb https://scripts.scowalt.com/setup/win.ps1 | iex
@eplord
eplord / machine-setup.ps1
Created March 2, 2025 07:37 — forked from danpetitt/machine-setup.ps1
Machine Setup using WinGet
Write-Host "Downloading and installing latest WinGet app...";
# Find latest version of WinGet
$wingetrooturl = "https://github.com/microsoft/winget-cli/releases/";
$wingetpage = "$($env:TEMP)\WinGet.html";
Invoke-WebRequest -Uri $wingetrooturl -OutFile $wingetpage
# Locate first msix bundle link
[regex]$regex = "<a href=`".*?(download\/v[0-9]+\.[0-9]+\.[0-9]+\/Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle)`" rel=`"nofollow`">";
@eplord
eplord / Windows-10-11-quick-fix-settings.ps1
Last active February 27, 2025 10:31 — forked from jonkeren/Windows-10-11-quick-fix-settings.ps1
Windows 10/11 misc. tweaks, settings, debloat. This is a fairly long list. I run these normally after a fresh Windows install. You can copy / paste this into an admin-Powershell window. All at once, or individually of course. Or, save as a .ps1 file and execute.
# Disable Xbox features
Get-AppxPackage "Microsoft.XboxApp" | Remove-AppxPackage
Get-AppxPackage "Microsoft.XboxIdentityProvider" | Remove-AppxPackage -ErrorAction SilentlyContinue
Get-AppxPackage "Microsoft.XboxSpeechToTextOverlay" | Remove-AppxPackage
Get-AppxPackage "Microsoft.XboxGameOverlay" | Remove-AppxPackage
Get-AppxPackage "Microsoft.Xbox.TCUI" | Remove-AppxPackage
# Disable Xbox GameDVR
reg.exe add "HKCU\Software\Microsoft\GameBar" /v "AllowAutoGameMode" /t REG_DWORD /d "0" /f
reg.exe add "HKCU\Software\Microsoft\GameBar" /v "ShowStartupPanel" /t REG_DWORD /d "0" /f
@eplord
eplord / WinSetView-Custom.ini
Created February 25, 2025 15:31 — forked from stamminator/WinSetView-Custom.ini
Windows 11 clean install guide
[Options]
ThemeIndex=3
Language=en-US
Font1=Consolas
Font2=Consolas
Size1=11
Size2=10
Scroll=1
Interface=2
Reset=0