Skip to content

Instantly share code, notes, and snippets.

# Script Description:
# This script safely deletes temporary files from the Windows partition, clears the Recycle Bin,
# removes the Windows Update cache, and cleans up the user's temp folder.
# Run with "powershell -ExecutionPolicy Bypass -File .\Clean-SystemDrive.ps1"
# Requires administrative privileges
if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
Write-Error "Please run this script as an Administrator."
exit
}
@filipnet
filipnet / export_wineventlog.ps1
Created April 14, 2023 09:02 — forked from iomoath/export_wineventlog.ps1
Powershell script to export Windows Events logs
# Logs to extract from server
$logArray = @("System","Security","Application", "Setup")
# Grabs the server name to append to the log file extraction
$servername = $env:computername
# Provide the path with ending "\" to store the log file extraction.
$destinationpath = "C:\WindowsEventLogs\"
# Checks the last character of the destination path. If it does not end in '\' it adds one.
@filipnet
filipnet / remove_moto_bloatware.bat
Last active July 30, 2025 12:47
ADB Command to Uninstall Bloatware and Remove its Data
# Enable Devoloper Options
# Download E5 USB-Driver http://www.motorola.com/getmdmwin
# Minimal and Install minimal ADB and fastboot https://androidmtk.com/download-minimal-adb-and-fastboot-tool
# ADB command to search for packages
pm list packages | grep "moto"
# ADB command to uninstall Bloatware but keep data
pm uninstall -k --user 0 <package name>
# ADB command to uninstall Bloatware and remove its data
pm uninstall --user 0 <package name>
@filipnet
filipnet / ps-wsus-export.ps1
Last active November 6, 2024 17:19
Export list of subscribed WSUS products and categories
# Export subscribed
$wsusServer = Get-WsusServer -Name $WSUS_HOSTNAME -Port 8530
$wsusSubscription = $wsusServer.GetSubscription()
$selectedProducts = $wsusSubscription.GetUpdateCategories() | Select Title
$selectedCategories = $wsusSubscription.GetUpdateClassifications() | select Title
# Export full list
(Get-WsusServer | Get-WsusClassification).Classification.Title
(Get-WsusServer | Get-WsusProduct).Product.Title