How to Convert HEIC to JPG Using PowerShell (No Third-Party Tools)

Convert HEIC to JPG using PowerShell

To convert HEIC to JPG using PowerShell, decode the photo with the Windows imaging decoder and save it with JpegBitmapEncoder. With the function from this page, it’s one line per photo or folder: It needs Microsoft’s free HEIF Image Extensions from the Microsoft Store. I tested it in PowerShell 7 and Windows PowerShell 5.1 on … Read more

Find Computers Not Logged In for 30 Days Using PowerShell

Find computers not logged in for 30 days using PowerShell

To find computers not logged in for 30 days with PowerShell, run Search-ADAccount with -AccountInactive, -ComputersOnly and a 30-day time span: It needs the ActiveDirectory module. Below I set that up, show the Get-ADComputer alternative, explain why the dates can be off by up to two weeks, and cover Microsoft Entra ID devices. My test … Read more

How to Convert a SecureString to Plain Text in PowerShell (7 and 5.1)

Convert a SecureString to plain text in PowerShell

To convert a SecureString to plain text in PowerShell 7, use ConvertFrom-SecureString with the -AsPlainText switch: Windows PowerShell 5.1 doesn’t have that switch, so there you’d use the NetworkCredential trick instead. I tested all of these methods in both versions, with sample passwords only. Convert a SecureString with ConvertFrom-SecureString -AsPlainText Printing a SecureString only shows … Read more

How to Find the Process Locking a File Using PowerShell

Find the process locking a file using PowerShell

To find the process locking a file using PowerShell, ask the Windows Restart Manager. It’s the same API installers use to see which apps hold a file, and it works without admin rights: FileLock.ps1 is a short script you’ll copy from this page. Below I also test whether a file is locked, scan a whole … Read more

How to List Windows Features Using PowerShell (Windows 11, 10 and Server)

List Windows features using PowerShell

To list Windows features using PowerShell on Windows 11 or 10, run Get-WindowsOptionalFeature in an admin window. It shows every optional feature and whether it’s enabled: Without admin rights, the Win32_OptionalFeature class gives the same list to any user, so most examples below use it. On Windows Server, Get-WindowsFeature lists roles and features instead. I … Read more

PowerShell Rename-Item: Rename Files and Folders

PowerShell Rename-Item rename files and folders

PowerShell Rename-Item renames a file, folder or registry key. Give it the current path and the new name, without a folder: Output: That’s all most renames need. Below I cover the mistakes that cause errors, bulk renames with a script block, names with square brackets and renaming folders safely. Every example ran in PowerShell 7 … Read more

How to List Local Administrators Using PowerShell

List local administrators using PowerShell

To list local administrators with PowerShell, run Get-LocalGroupMember on the Administrators group. It works without admin rights in PowerShell 7 and 5.1: Below I run it, make it work on any language of Windows, use net localgroup as a fallback, check remote PCs and explain why an admin account isn’t always running as admin. List … Read more