r/PowerShell • • 13d ago

Question Good powershell profile tips

I’ve been having way too much fun customizing my PowerShell profile lately. 😂
Here’s what I’ve got so far:
root — Prompts for my Domain Admin credentials and launches a new elevated PowerShell session.
Green errors — Because Don Jones taught me that errors don’t have to be angry red.
Custom prompt — Shows my current path and the time, so I can tell how long commands took.
save-clip — My homemade clipboard vault! Password-encrypts whatever’s on my clipboard and saves it to a file. Even works with images.
Admin indicator — Makes it obvious when I’m running elevated.
Extended scrollback — Because nothing hurts quite like scrolling up to find something important, only to discover PowerShell already ate it. 😭
record — My next addition! A one-word shortcut to start a PowerShell transcript, timestamp the log file, and record my session. Maybe a stoprecord companion too.
I’m starting to think my PowerShell profile is becoming its own operating system.
What other clever functions, shortcuts, or quality-of-life improvements have you all added to yours? I’m looking for ideas worth stealing. 😂

85 Upvotes

52 comments sorted by

View all comments

1

u/FleetOpsNotes 10d ago

Has anyone added a device lookup to their PowerShell profile? I'd like something that takes a computer name and returns the logged-on user, serial number and last boot time. Would Get-CimInstance be your starting point, or is there a better approach?

1

u/Incrediblecodeman 9d ago

Good idea but most people have an MDM like tanium and just run the quarry through that. Although Your way only works if machine is on and those services are healthy. If I have a dollar for every time winrm was down

I’ll still try it today and report back