Productivity boost for Windows using PowerShell
The easypeasy PowerShell module simplifies and automates common tasks in Windows environments:
- manage locations on the system path
- manage environment variables
- create and remove start menu shortcuts
- create scheduled tasks
- switch between light and dark themes
- create timestamps
- show disk usage
- run a command as administrator (sudo)
- verify administrator privileges
in a specific scope (machine or user)
default: effective in current shell
> path
Scope Location
----- --------
Machine C:\Program Files\PowerShell\7
Machine C:\Program Files\Microsoft VS Code\bin
Machine C:\Windows\system32
Machine C:\Windows
User C:\Users\me\go\bin
Process C:\Program Files\PowerShell\7
...path is an alias for Get-SystemPath, which you should use in scripts.
Each location is tagged with its scope: Machine, User, or Process — the last for entries present only in the current shell's PATH and not persisted.
> path *Windows*
Scope Location
----- --------
Machine C:\Windows\system32
Machine C:\Windows
...*Windows* is the -Filter parameter, which you should name explicitly in scripts.
> Get-SystemPathLocation "C:\Windows"
> Get-SystemPathLocation -Filter "*\Git\*"
> Get-SystemPathLocation -Filter "*\Git\*" -User
Scope Location
----- --------
Machine C:\WindowsBoth commands accept an exact -Location (positional) or a -Filter wildcard, and the scope switches -Machine and -User. Each result carries the scope it was found in: Machine, User, or Process.
in a specific scope (machine or user)
default: effective in current shell
> Test-SystemPathLocation "C:\Program Files\Git\bin"
> Test-SystemPathLocation -Filter "*\Git\*" -Machine
Truein a specific scope (machine
default: machine scope
> addpath "C:\Program Files\MyApp"
> addpath -User "C:\Program Files\MyApp"
> addpath -Front "C:\Program Files\MyApp" # this folder will be searched first
> rmpath "C:\Program Files\MyApp" # removes every occurrence of this pathaddpath and rmpath are aliases for Add-SystemPathLocation and Remove-SystemPathLocation respectively, which you should use in scripts.
in a specific scope (machine
default: both, keeping a cross-scope duplicate on the machine PATH
> deduppath # both scopes; keeps machine on overlap
> deduppath -KeepMachine # both scopes; keeps machine on overlap (explicit)
> deduppath -KeepUser # both scopes; keeps user on overlap
> deduppath -Machine # machine PATH only
> deduppath -User # user PATH onlydeduppath is an alias for Remove-DuplicateSystemPathLocations, which you should use in scripts.
Within a scope, the first occurrence of each folder is kept.
> movepath "C:\Program Files\Git\bin" -ToUser # machine -> user
> movepath "C:\Program Files\Git\bin" -ToMachine # user -> machinemovepath is an alias for Move-SystemPathLocation, which you should use in scripts.
The folder is removed from the source PATH and added to the target PATH.
> Backup-SystemPathin a specific scope (effective, machine or user)
default: effective in current shell
> getenv JAVA_HOME
> getenv -Machine JAVA_HOME
> getenv -User JAVA_HOME
C:\Java\jdk-21getenv is an alias for Get-EnvironmentVariable, which you should use in scripts.
in a specific scope (machine
default: machine scope
> setenv JAVA_HOME "C:\Java\jdk-21"
> setenv -User JAVA_HOME "C:\Java\jdk-21"
> rmenv JAVA_HOME
> rmenv -User JAVA_HOMEsetenv and rmenv are aliases for Set-EnvironmentVariable and Remove-EnvironmentVariable respectively, which you should use in scripts.
for all users (default) -User)
The shortcut will be created as MyApp in the MyApp programs folder.
The argument -Debug will be passed to the executable.
> New-StartMenuShortcut `
-AppName MyApp `
-Executable "C:\Program Files\MyApp\MyApp.exe" `
-Arguments "-Debug" `
-Icon "C:\Program Files\MyApp\MyBeautifulIcon.ico"
> New-StartMenuShortcut -User -AppName MyApp -Executable "C:\Program Files\MyApp\MyApp.exe" # current user, no adminAn existing shortcut is left untouched and a terminating error is reported, unless -Force is given to overwrite it.
> New-StartMenuShortcut -Force -AppName MyApp -Executable "C:\Program Files\MyApp\MyApp.exe"in the all-users (default) -User) Start Menu
> Remove-StartMenuShortcut MyApp
> Remove-StartMenuShortcut -User MyAppThe shortcut's containing folder is removed too when it becomes empty. A terminating error is reported if the shortcut does not exist.
> New-PowershellStartMenuShortcut `
-AppName "Kill Node.js" `
-Command "Stop-Process -Name node -Force"
> New-PowershellStartMenuShortcut -AppName "Run System Update" `
-Script "C:\Scripts\system-update.ps1" `
-Maximized -KeepOpen -Admin-Script is an alias for -Command that can be used for expressiveness.
-Admin is an alias for -RunAsAdministrator that can be used for conciseness.
Both accept -Force to overwrite an existing shortcut.
equivalent to checking Process Explorer's menu item Options > Run At Logon
Register-LogonTask `
-Name "Process Explorer-${env:\USERDOMAIN}-${env:USERNAME}" `
-Executable "$env:LOCALAPPDATA\Microsoft\WindowsApps\procexp.exe" `
-Argument "/t" `
-Force> themetheme is an alias for Switch-Theme. Get-Theme, Set-Theme, Switch-Theme and theme will be removed in v2.
> theme dark
> theme light> time
2024-01-01_20.15.00
> & .\system-update.ps1 > "$env:TEMP\system-update-$(time).log"time is an alias for Get-Timestamp, which you should use in scripts.
Runs the given command in an elevated PowerShell session via the Windows sudo command, prompting for confirmation through the User Account Control dialog.
> sudops addpath -Machine "C:\Tools"
> sudops setenv -Machine JAVA_HOME "C:\Java\jdk-21"
> sups Set-Theme darksudops (and the shorter sups) is an alias for Invoke-Elevated, which you should use in scripts. Requires the Windows sudo feature to be installed and enabled.
> Assert-Administrator
Assert-Administrator: This operation requires administrator privileges.> Get-Usage
Name Sum (MB) Sum
---- -------- ---
C:\easypeasy\systempath.ps1 0,011 11297,00
C:\easypeasy\startmenu.ps1 0,006 5961,00
C:\easypeasy\environment.ps1 0,006 5873,00
C:\easypeasy\easypeasy.psd1 0,005 5748,00
C:\easypeasy\README.md 0,005 5243,00
C:\easypeasy\theme.ps1 0,003 2692,00
C:\easypeasy\task.ps1 0,001 1497,00
C:\easypeasy\specialfolder.ps1 0,001 1299,00
C:\easypeasy\.vscode 0,001 1116,00
C:\easypeasy\LICENSE.txt 0,001 1070,00
C:\easypeasy\shortcut.ps1 0,001 991,00
C:\easypeasy\volume.ps1 0,001 628,00
C:\easypeasy\timestamp.ps1 0,001 541,00
C:\easypeasy\explorer.ps1 0,000 481,00
C:\easypeasy\.github 0,000 432,00
C:\easypeasy\administrator.ps1 0,000 374,00
C:\easypeasy\easypeasy.psm1 0,000 349,00du is an alias for Get-Usage. Both will be removed in v2.
To install the easypeasy module from the PowerShell Gallery, run the following command in PowerShell:
Install-Module easypeasyTo install the easypeasy module, follow these steps:
-
Download the module folder from GitHub to your computer.
-
Open PowerShell and run the following command to check the installation path for PowerShell modules:
$env:PSModulePath -
Copy the easypeasy module folder to one of the paths listed in the output of the previous command, e.g. the user's module path:
$HOME\Documents\WindowsPowerShell\Modules\ -
Open a new PowerShell session or reload your profile to make the module available. You can check if the module is available by running:
Get-Module -ListAvailable
Please contribute to the easypeasy module. Issues and pull requests are very welcome. Thank you!
The easypeasy module is licensed under the Apache License, Version 2.0. See the LICENSE.txt file for details.
Copyright 2023-2026 Igor Akkerman
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Thanks to everyone supporting and contributing to easypeasy.
