Day: January 16, 2020

PowerShell: Get CRC Signature of a File

2/10/20 Update: xxHash will beat both of these in term of speed. Hence, this blog…

PowerShell: Get MD5 Hashing Signature of a File

# Get-MD5-Hash.ps1# Get-FileHash (PowerShell 4.0+) replacement for Windows 2008. Forward-compatible.function getMd5{ param( $file, $md5 =…

PowerShell: Find Process IDs of a Locked File and Kill It

There's a newer iteration of this function here. $targetFile='C:\Users\kimconnect\Desktop\testfile.csv' function killPidLockedFile($filename){ if (!(Get-Command handle.exe -ErrorAction…

PowerShell: Purge User Outlook Profile

# Purge-User-Outlook-Profile.ps1# Set folder path$folderToDelete="$env:localappdata\Microsoft\Outlook";function purgeFolder($path){ mkdir c:\temp -force -ea SilentlyContinue | out-null cd c:\temp…

PowerShell: How To Make A System App Do Nothing

# How-To-Make-Existing-System-App-Do-Nothing.ps1# Provide variables$hive="REGISTRY::HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\WORDPAD.EXE"$key="(default)"$value="C:\Windows\dummy.exe"$defaultValue="C:\Program Files\Windows NT\Accessories\WORDPAD.EXE"# Dummy-File-Creator.ps1$dummyFile="C:\Windows\dummy.exe"$output = new-object byte[] 1; (new-object Random).NextBytes($output);[IO.File]::WriteAllBytes($dummyFile, $output);if…