PowerShell-based installation¶
PowerShell-based installation refers to the method of using the PowerShell command-line shell to download and execute setup scripts directly from the internet, often used for installing package managers or software on Windows systems.
Mechanism¶
This installation method typically utilizes the Invoke-Expression cmdlet combined with System.Net.WebClient to fetch a script from a remote URL and execute it immediately within the current session.^[400-devops-02-os-and-linux-basics-windows-scoop.md] This eliminates the need to manually download and run setup files.
Prerequisites¶
While scripts may run in the standard Windows PowerShell, it is often recommended to use PowerShell 7 (pwsh) for executing these installation commands.^[400-devops-02-os-and-linux-basics-windows-scoop.md]
Usage Example¶
The following command pattern is commonly used to install tools like Scoop:
Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://get.scoop.sh')
When executed, this command initializes the download, extracts the necessary files, creates Shims, and modifies the system path automatically.^[400-devops-02-os-and-linux-basics-windows-scoop.md]
Scoop¶
PowerShell-based installation is the standard procedure for deploying Scoop, a command-line installer for Windows.^[400-devops-02-os-and-linux-basics-windows-scoop.md] By using this method, Scoop can be installed into the user's home directory without requiring administrator privileges or triggering User Account Control (UAC) prompts.^[400-devops-02-os-and-linux-basics-windows-scoop.md]
Sources¶
^[400-devops-02-os-and-linux-basics-windows-scoop.md]