r/PowerShell • u/iykecode • Dec 01 '25
PowerShell Profile
What cool things have you done with your profile?
10
Upvotes
r/PowerShell • u/iykecode • Dec 01 '25
What cool things have you done with your profile?
22
u/nealfive Dec 01 '25
After adding a ton of cool stuff… it took too long to load and nothing was way cooler than waiting. So I cleared my profile again lol
6
u/Future-Remote-4630 Dec 01 '25
I have a function that will extract any variables in the last command that I ran and see if any of them are null. They output warning messages so you know where the thing went wrong without needing to investigate it.
6
u/Kirsh1793 Dec 01 '25
At my job, I work in multiple environments. I set up a .psd1 config file and wrote a profile script that works in all environments. It defines a customizable prompt (no OhMyPosh at work, sadly), sets PSDefaultParameterValues for my own and some third party modules, loads WIP modules, updates help in a background job triggering a notification when that's done, and loads defined variables. It takes between 2-4 seconds to load.
4
u/BlackV Dec 01 '25
Added a ps version to the prompt on a couple of machines, otherwise default cause the 400 separate places I login would be a waste of time carting my profile everywhere
2
u/Sin_of_the_Dark Dec 02 '25
I get a dad joke every time I open a new shell.
1
u/lan-shark Dec 01 '25 edited Dec 02 '25
Nothing out of the ordinary for me but oh-my-posh is a great place to start
1
u/Mesmerise Dec 01 '25
Just a little function I can use to test AD logins at the command line.
1
u/tr3yff Dec 01 '25
On mu job I need to set proxy, so I do that on Profile.
1
u/Impossible_IT Dec 01 '25
Added date & time to the prompt, but I really only use ISE and I know it has been deprecated.
1
u/CyberChevalier Dec 01 '25
Oh-my-posh
For profile like for car :
Light is right !
All I need is into my module folder with well discoverable verb-noun functions
1
u/g3n3 Dec 02 '25
Prompt play and formatters for file info and custom tools for shares and variables. Environment variables for various cli binaries like bat and fzf. Lots of aliases and functions to help page data. The biggest pain is scrolling back up.
1
u/pm_op_prolapsed_anus Dec 02 '25
Aliases to programs installed with winget. If I load oh-my-posh the vs package manager terminal gets all screwed up with control characters. At one point I had called the devenv batch file for visual studio so I had access to tf in my console without opening the vs 2022 developer ps from Windows menu (because I always forget it's there) or opening from the vs tools menu. But I just made tf an alias like my winget programs and stopped doing that. Can't remember why exactly, I think an upgrade of vs 2022 removed the old batch script
1
u/Glass-Technician-714 Dec 02 '25
Just some usefull function for my daily work and some alias settings:
my ps profile
1
u/Ok-Shake5054 Dec 02 '25
Automated the detection method for office 365, having the script going into Microsoft to check the lates 3 version of office and comparinf it with the current install, if older forcea the inatallation.
1
u/NsRhea Dec 02 '25
I set up a psm1 to generate an inventory of machines in different ou's and separate them into different variables. On Powershell loading it gives me the ability to call the list or any set variable and do whatever I want. I also set up a connection test one as well so I can now implement different functions and rule out offline devices
1
u/heyitsgilbert Dec 03 '25
My profile mostly loads functions from other scripts. I have a prompt switch function (got the idea from Sean Wheeler). I have a slightly different cd that supports
-and.... I use chezmoi to keep my profiles synced. https://github.com/HeyItsGilbert/dotfiles/tree/main/dot_local%2Fshare%2Fpowershell%2FScripts1
u/jsiii2010 Dec 03 '25 edited Dec 03 '25
1
u/narcissisadmin Dec 04 '25
First and foremost, mine enables bash-style tab completion. It boggles my mind that it's not just like that by default.
It also makes the prompt minimal and sets the title bar to the current path, prepended with ADMIN if it's elevated.
1
u/Ok_Mathematician6075 Dec 04 '25
Not installed malware.
-4
u/pigers1986 Dec 01 '25
I did not used it - way to much to f4ck you work!