This PowerShell profile makes the Windows PowerShell a bit better
Save Profile.ps1
in Documents/WindowsPowershell/
.
Save Profile.ps1
to Documents/Powershell/Microsoft.PowerShell_profile.ps1
Powershell has a lot of quality of life upgrades. I recommend installing it and setting it as the default with Windows Terminal (https://apps.microsoft.com/store/detail/windows-terminal/9N0DX20HK701). You can install Powershell 7 with the built-in Windows packet manager winget
like this: winget install --id Microsoft.Powershell --source winget
.
Setting it to be the default shell is done by opening up the settings, then opening the settings.json:
Change the defaultProfile value to be the GUID of the Powershell 7 profile. Below you can see the GUID of mine which I found further down in the json file. Copy the GUID and add it as the defaultProfile value.
What it does is:
- Makes tab-completion look and feel like Linux. It presents all options instead of rotating through each option.
- Creates function
Get-History-Full
, with aliashist
. This allows you to see all commands you've run previously. - Creates alias
head
forselect-object
, allowing us to do things likehead -First 10
. - Edits the prompt to include the current branch, if the folder is a git repo.
- Loads all fabric patterns and makes them available as functions, allowing things like
get-clipboard | <pattern>
, e.g.iwr example.com | so -ExpandProperty content | summarize
and of course much much more. - Installs aadintenrals if it is not already installed. Can be then used by
import-module aadinternals