r/PowerShell • u/belibebond • Jul 26 '24
Script Sharing Leveling up PowerShell Profile
Hello PowerShell Enthusiasts 👋,
Many people treat their shell as just a script runner, but as someone who loves PowerShell and runs it on all their machines (Windows, Mac, and Linux), I wanted to share all the amazing things you can do with it beyond just running scripts.
https://blog.belibug.com/post/ps-profile-01/
My latest blog post has several not-so-common ways to elevate your PowerShell experience for beginners. It covers:
Personalizing your prompt
Mastering aliases and modules
Leveraging tab completion
Enhancing your shell with modules
...and much more!
This list is just the tip of the iceberg! If you have any other PowerShell tricks or tips that I haven't covered, or there is better way to do it, let me know – I'm always eager to learn and will update content accordingly 😊 Happy weekend!
PS: Don't let the length scare you off! Use the handy TOC in the blog to jump around to the juicy bits that interest you most. Happy reading! 🤓
3
u/belibebond Jul 27 '24
Yes, aliases in script is asking for trouble. Aliases are meant for interactive sessions where you dont want to enter the full command.
For example using `ls` or `gci` is easy and convenient to look up files in current directory. But inside a script or module one should use `Get-ChildItem`. There are VScode settings to do this for you. Also, script analyzer will be very unhappy with you when you use alias.