Skip to the content.

Installing Modules

Unless you’re working on a server, a PAW, with a lot of different local profiles, or with an automation solution, strongly consider always installing modules to CurrentUser scope. Its easier to maintain, update, etc

Install-Module <<MODULENAME>> -Scope CurrentUser

See Module Management in PowerShell Commands for more commands.

Terminal Emulator Quake Mode on startup

Use a shell/terminal emulator that you can start on startup and that supports what is often called quake mode. cmder and Windows Terminal support quake mode and it shouldn’t be too hard tell windows to launch them on startup.

The idea is that you will use a very quick keyboard shortcut (normally CTRL + ~) to bring up the shell and hide it (but not close it) again and often, so its quickly available for you. By reducing the time to get to the shell and also your brain becoming more aware that its quicker to get to, you will start using it more often, thus getting you more experience.

No matter what your terminal emulator to shell, learn common shortcuts to help with your speed.

Often forgotten

Checkout Commands often forgotten in PowerShell Commands
Checkout Variables often forgotten in PowerShell Commands

File Locations of PS Components

Modules

PowerShell 7:

https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_psmodulepath?view=powershell-7.5

Windows PowerShell 5.1:

https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_psmodulepath?view=powershell-5.1

Authentication Methods

-DeviceLogin: Really good if you access multiple tenants or have multiple accounts.

-Interactive

Using Single Browser with multiple profiles

Tools

https://cmder.app/: Nice terminal emulator that has a bunch of great includes. https://aka.ms/terminal / https://github.com/microsoft/terminal - i’m not totally on the Windows Terminal bandwagon yet but its not shit.

Also check Misc Tools

Traps and Gotchas

https://github.com/nightroman/PowerShellTraps

Invoke-WebRequest and Invoke-RestMethod on PS5

Invoke-WebRequest and Invoke-RestMethod on Windows PowerShell 5.1 does not have the parameter -Authentication, Only PowerShell7 does. This means you have to manually construct the header to include authentication.

https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/invoke-webrequest?view=powershell-5.1
https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/invoke-webrequest?view=powershell-7.5#-authentication
https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/invoke-restmethod?view=powershell-5.1
https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/invoke-restmethod?view=powershell-7.5#-authentication

PowerShell Resources

https://github.com/janikvonrotz/awesome-powershell\