custom powershell profile with some useful functions and aliases for my personal use. on github for easy access and sharing across work and school computers.
adopted from Tim Sneath https://gist.github.com/timsneath/19867b12eee7fd5af2ba
you may want to add -NoLogo to any instance of powershell.exe
create a powershell profile by entering this directly into powershell, and then you could just do what you want with this profile.ps1
file:
-
open powershell and enter:
if (!(Test-Path $PROFILE.CurrentUserAllHosts)) { New-Item $PROFILE.CurrentUserAllHosts -ItemType File -Force }
-
open the file with:
notepad $PROFILE.CurrentUserAllHosts
OR:
Invoke-Item $PROFILE.CurrentUserAllHosts
Edit-Profile
- opens the profile file (you may need to make.ps1
files open with your preferred text editor by default)Admin
orsudo
- runs the following command as administrator, or opens a new powershell window as administrator if no command is givenGet-IP
- gets the public IP address of the current machinewhereis
- finds the location of a file on pathUpdate-Drivers
,Update-Windows
,Update-All
- updates drivers, windows, or both + winget apps