r/PowerShell • u/itiscodeman • Jul 14 '26
Question What’s in your profile ?
What’s the coolest function or hack you got
I have window title bar show “isAdmin”
I have errors go green
I have it concatenation long file paths to save prompt space(cool)
I have a timestamp as the prompt so I can know when I ran a robocopy to judge timing
I have a number of functions to run things elevated (like dsa)
What’s cool ideas !?
Notepad $profile
40
Upvotes
7
u/Idakay Jul 14 '26
I've got a few!
Some of them change directories for me to common areas (home, scripts, tmp). Those single words move my cwd.
I've got one to code sign whatever script is open in ise/vscode or if I'm in a terminal I can give the file name and it signs it with my cert.
Another called signb(signbomb) just signs every script in the cwd recursively(working on a bunch of stuff or modules)
I've got another called runit for scripts sitting on network shares that would typically be blocked by applocker, it copies them to an applocker allowed directory, runs them and then cleans up the copy.
I have some other stuff I'm forgetting but those are my most used. I'd have to look at my profile for more.
4
u/Proxiconn Jul 16 '26
Get-Aduser | Remove-Adobject $confirm:$false
2
u/Raskuja46 Jul 15 '26
I have my profile calling functions from a custom module I built to set my speaker volume.
2
u/StartAutomating Jul 16 '26
I'm just going to dump my current profile as-is.
It only imports two modules ugit and Posh
The prompt is a work in progress.
6
u/Ecrofirt Jul 15 '26
A function that plays at 852Hz beep for the amount of time I specify, defaulting to 30 minutes.
Why? WHY?
It shuts my brain off. If I've got something to do it literally stops the 'background noise' and lets me focus explicitly on the task at hand. Works best with headphones.
2
u/BlackV Jul 14 '26 edited Jul 14 '26
very very little, I just use it in too many places for it to nicely happen
On my management server I also have management related stuff
A nice way to present that could be (from another profile)
1
u/recoveringasshole0 Jul 16 '26
I would show you but this sub doesn't allow images which is fucking stupid.
3
u/jwk6 Jul 15 '26
Oh my posh.
1
u/purplemonkeymad Jul 15 '26
Just psreadline settings and default argument values. I keep functions out of my profile and put them in proper modules.
Of those that were quick little things that i use regularly on my pc are
But i'm on a lot of other computers with clean powershell's so I mostly don't have a lot, otherwise i might end up getting used to having those customisations.
1
u/daweinah Jul 15 '26
I'm honestly not sure if it's a profile or not, but my "home tab" is a script that I run and has Y/N prompts to connect to ExO and Sec, Graph, or Teams modules. It also has several functions for occasional tasks that used to be saved as separate scripts: things like check inbox rules and forwarding, check OOO message, get extension attributes, etc.
1
u/iamLisppy Jul 15 '26
Set-PSReadlineOption -PredictionViewStyle ListView
Set-PSReadLineOption -MaximumHistoryCount 4096
Set-PSReadLineKeyHandler -Key Tab -Function Complete
Set-PSReadLineOption -BellStyle None
25
u/[deleted] Jul 15 '26
[removed] — view removed comment