2017-04-27 19:14:25 +02:00
# install-powershell.sh
## Features of install-powershell.sh
2019-10-30 20:31:49 +01:00
* Can be called directly from git
* Optionally installs vs code and vs powershell extension (aka PowerShell IDE) using optional `-includeide` switch
* Defaults to completely automated operation (if appropriate permissions are available)
* Automatically looks up latest version via git tags
* Automatic selection of appropriate install sub-script
* Configures software installs for repositories when repositories are in place, otherwise pulls files from git releases. As repository versions are made available, script will be updated to take advantage.
* User permission checking
* Sub-installers called from local file system if they exist, otherwise pulled from git
* Sub-installers can be called directly if auto-selection is not needed
2017-04-27 19:14:25 +02:00
## Minimum Requirements for install-powershell.sh
* bash shell
* `sed`
* native package manager available
* `curl` (auto-installed if missing)
2019-03-12 00:19:05 +01:00
* `tr`
2017-04-27 19:14:25 +02:00
2018-06-25 20:44:43 +02:00
## Parameters
2019-03-08 22:00:04 +01:00
* -includeide - installs VSCode and VSCode PowerShell extension (only relevant to machines with a desktop environment)
* -interactivetesting - do a quick launch test of VSCode (only relevant when used with -includeide)
* -skip-sudo-check - use sudo without verifying its availability (hard to accurately do on some distros)
* -preview - installs the latest preview release of PowerShell core side-by-side with any existing production releases
2018-06-25 20:44:43 +02:00
2017-04-27 19:14:25 +02:00
## Usage
### Direct from Github
```bash
bash < (wget -O - https://raw.githubusercontent.com/PowerShell/PowerShell/master/tools/install-powershell.sh) < ARGUMENTS >
wget -O - https://raw.githubusercontent.com/PowerShell/PowerShell/master/tools/install-powershell.sh | bash -s < ARGUMENTS >
```
### Local Copy
```bash
bash install-powershell.sh < ARGUMENTS >
```
## Examples
2017-07-21 23:20:51 +02:00
### Only Install PowerShell Core
2017-04-27 19:14:25 +02:00
```bash
bash < (wget -O - https://raw.githubusercontent.com/PowerShell/PowerShell/master/tools/install-powershell.sh)
```
2017-07-21 23:20:51 +02:00
### Install PowerShell Core with IDE
2017-04-27 19:14:25 +02:00
```bash
bash < (wget -O - https://raw.githubusercontent.com/PowerShell/PowerShell/master/tools/install-powershell.sh) -includeide
```
2017-07-21 23:20:51 +02:00
### Install PowerShell Core with IDE and do tests that require a human to interact with the installation process
2017-04-27 19:14:25 +02:00
```bash
bash < (wget -O - https://raw.githubusercontent.com/PowerShell/PowerShell/master/tools/install-powershell.sh) -includeide -interactivetesting
```
### Installation To do list
2018-06-25 20:44:43 +02:00
* Detect and wait when package manager is busy/locked? - at least Ubuntu (CentOS does this internally)
2019-10-30 20:31:49 +01:00
# install-powershell.ps1
## Features of install-powershell.ps1
* Can be called directly from git
* Optionally allows install of the latest Preview build
* Optionally allows install of the Daily build
* Optionally installs using the latest MSI
* Automatically looks up latest version via git tags
* Optionally installs silently
* Optionally adds the install location to Path environment variable
## Examples
### Install PowerShell Core Daily Build
```PowerShell
Invoke-Expression "& { $(Invoke-RestMethod 'https://aka.ms/install-powershell.ps1') } -daily"
```
### Install PowerShell Core using the MSI installer
```PowerShell
Invoke-Expression "& { $(Invoke-RestMethod 'https://aka.ms/install-powershell.ps1') } -UseMSI"
```