Customize your PowerShell Environment
I recommend you customize your PowerShell environment by editing your Profile. As administrator in PowerShell edit your profile file with:
notepad $profile
Add the following lines to the profile:
new-alias edit "C:\Program Files\Notepad++\notepad++.exe" remove-item alias:curl function prompt { $ptp = (get-location).path -replace 'Microsoft\.PowerShell\.Core\\FileSystem\:\:','' $ptp = 'PS ' + $ptp + '> ' $ptp } remove-item alias:history function hist {edit -n999999999 (Get-PSReadlineOption).HistorySavePath} new-alias history hist set-location <to wherever you want to start>
Explanation of additions.
- Where edit is aliased to whatever your favoring text editor is so you only have to type edit filename to open a file.
- I like the normal curl.exe so I unset the built in alias to invoke-webrequest.
- I change the prompt to be a little more sane when accessing UNC paths.
- Set history so it opens the entire PSReadline history file in the text editor.
- I like to start in a known location when opening PowerShell both as regular user and administrator, so I set that location.
Since Windows does not have a built-in Whois tool I alias Whois to Nirsoft's whosip.exe so I can say
whois 8.8.8.8