# PowerShell 7 # Cmdlet ^[[Cmdlet Overview - PowerShell | Microsoft Learn](https://learn.microsoft.com/en-us/powershell/scripting/developer/cmdlet/cmdlet-overview?view=powershell-7.3)] A cmdlet is a lightweight command that is used in the PowerShell environment. The PowerShell runtime invokes these cmdlets within the context of automation scripts that are provided at the command line. The PowerShell runtime also invokes them programmatically through PowerShell APIs. # Install ## MacOS There are several ways to install PowerShell on macOS. Choose one of the following methods^[[Installing PowerShell on macOS - Microsoft Learn](https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell-on-macos?view=powershell-7.4)]: - Install using [Homebrew](https://brew.sh/). Homebrew is the preferred package manager for macOS. - Install PowerShell via [Direct Download](https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell-on-macos?view=powershell-7.4#installation-via-direct-download) - Install from [binary archives](https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell-on-macos?view=powershell-7.4#binary-archives). ### Homebrew [[Homebrew]] must be installed, then run the following command. ```sh brew install powershell/tap/powershell ``` Verify the install is working ```sh pwsh ``` When new versions of PowerShell are released, update Homebrew's formulae and upgrade PowerShell: ```sh brew update brew upgrade powershell ``` # Uninstall ## MacOS ### Homebrew ```zsh brew uninstall --cask powershell ```