|
| 1 | +--- |
| 2 | +RFC: RFC0031 |
| 3 | +Author: Joey Aiello |
| 4 | +Status: Withdrawn |
| 5 | +SupercededBy: N/A |
| 6 | +Version: 0.1 |
| 7 | +Area: External Module |
| 8 | +Comments Due: 7/15/2017 |
| 9 | +--- |
| 10 | + |
| 11 | +# PowerShellCore Installer/Utility Module |
| 12 | + |
| 13 | +A PackageManagement provider called `PowerShellCoreProvider` that ships on the [PowerShell Gallery](https://powershellgallery.com/) |
| 14 | +and eases installation and configuration of PowerShell Core on Windows. |
| 15 | + |
| 16 | +## Motivation |
| 17 | + |
| 18 | +Installation and configuration of PowerShell Core on Windows is tricky due to the wide range of Windows versions that we support (7-10 and Server 2008R2-2016) |
| 19 | +and because of the usage of some "system" concepts shared by Windows PowerShell like the WinRM remoting plugin. |
| 20 | + |
| 21 | +## Goals |
| 22 | + |
| 23 | +* I can install PowerShell Core across all supported versions of Windows and Windows PowerShell *at scale*. |
| 24 | +* I can install PowerShell Core on certain versions of Windows and Windows PowerShell without remembering highly arcane commands or manually downloading a package from a well-known location. |
| 25 | +* I can update PowerShell Core in-place after it's already been installed. |
| 26 | +* I can uninstall PowerShell Core using Windows PowerShell |
| 27 | +* I can register PowerShell Core as a WinRM remoting endpoint across all supported versions of Windows and Windows PowerShell *at scale*. |
| 28 | + |
| 29 | +## Specification |
| 30 | + |
| 31 | +Ship a module on Gallery called `PowerShellCoreProvider` which contains the following cmdlets: |
| 32 | + |
| 33 | +* Install-PowerShellCore |
| 34 | + * Download and install the latest PowerShell Core MSI and install it using the MSI PackageManagement provider |
| 35 | +* Update-PowerShellCore |
| 36 | + * If PowerShell Core is already installed, this will grab the latest PowerShell Core MSI and do an in-place upgrade of the MSI-installed instance on the machine. |
| 37 | +* Uninstall-PowerShellCore |
| 38 | + * Uninstall the PowerShell Core MSI using the MSI PackageManagement provider. |
| 39 | +* Register-PowerShellCoreEndpoint |
| 40 | + * Call the Install-PowerShellRemoting.ps1 script in PowerShell Core's `$PSHome`. |
| 41 | + |
| 42 | +These cmdlets allow me to do things like: |
| 43 | + |
| 44 | +```powershell |
| 45 | +Invoke-Command -ComputerName $TargetNode -Credential DOMAIN\BestAdmin -ScriptBlock {Install-Module PowerShellCore -Force; Install-PowerShellCore; Register-PowerShellCoreEndpoint} |
| 46 | +``` |
| 47 | + |
| 48 | +`PowerShellCoreProvider` should start as a 0.1 release so that we can make breaking changes as we gather feedback in PowerShell Core 6.0 beta. |
| 49 | +It should also ship as a standalone module outside of the PowerShell Core package. |
| 50 | + |
| 51 | +Right now, I think it's perfectly okay to ship all of these with nothing but common parameters. |
| 52 | +Based on feedback to this RFC, we should prioritize a set of parameters that might be useful. |
| 53 | +(For example, we may eventually add a `-Source` to `Install/Upgrade-PowerShellCore` that points to `GitHub` and some other, more official, source.) |
| 54 | + |
| 55 | +## Alternate Proposals and Considerations |
| 56 | + |
| 57 | +### Tracking Side-by-Side Installations of Powershell Core |
| 58 | + |
| 59 | +In the future, it may become necessary for this provider to help manage the installation of multiple copies of PowerShell Core (or even Windows PowerShell). |
| 60 | +Similar to `venv` for Python or `rbenv` for Ruby, |
| 61 | +this feature might enable users to call into various versions of PowerShell, or |
| 62 | +handle symlinking of the "primary" PowerShell to a specific version. |
| 63 | + |
| 64 | +However, until PowerShell Core has moved to a new version (e.g. 7.x or 6.1), |
| 65 | +this feature isn't necessary and is therefore out of scope for this RFC. |
| 66 | + |
| 67 | +### Additional parameters |
| 68 | + |
| 69 | +Eventually, it might be useful to have some of these parameters: |
| 70 | + |
| 71 | +* `-Version`: Specify an exact version to install. |
| 72 | +* `-Source`: Specify whether to pull the MSI from `GitHub` vs. the trusted location we publish our "official" MSI. |
| 73 | +* `-SideBySide`: Install or update PowerShell Core without replacing the existing version. |
| 74 | + |
| 75 | +### Nano Server |
| 76 | + |
| 77 | +Given that Nano Server currently has Docker containers with the latest version of PowerShell Core, Nano Server is out of scope for this RFC. |
| 78 | +However, it's perfectly reasonable that a future version of `PowerShellCore` could extend itself to support Nano Server via the same set of cmdlets. |
| 79 | + |
| 80 | +### Servicing |
| 81 | + |
| 82 | +MSIs have well-known patterns for updates and servicing (e.g. WSUS, SCCM, etc). |
| 83 | +While it's curently unclear *where* we should publish these MSIs to best enable these servicing patterns, |
| 84 | +delivering an out-of-band application via an MSI is better than other alternatives for notifying administrators and user of security fixes and critical updates. |
| 85 | + |
| 86 | +### Tracking "Portable" Copies of PowerShell |
| 87 | + |
| 88 | +PowerShell Core can be installed in a "portable" manner by simply extracting a ZIP running `powershell.exe`. |
| 89 | +(Similarly, "portable" PowerShell Core has its own `Install-PowerShellRemoting.ps1` that can be run as Administrator.) |
| 90 | +It is currently out-of-scope to "register" or install "portable" copies of PowerShell Core using the `PowerShellCore` module. |
| 91 | +(If you do want to build some automation around non-MSI installs, you might want to look into the [PSReleaseTools](https://www.powershellgallery.com/packages/PSReleaseTools) by @jdhitsolutions). |
| 92 | + |
| 93 | +### Appx Package |
| 94 | + |
| 95 | +Appx is a package format introduced in Windows 8 to support installation of Universal Windows Platform (UWP) applications both inside and outside of the Windows Store. |
| 96 | +While we may still build an Appx package to release on the Store in the future, |
| 97 | +this particular package will not be able to perform administrative actions from within the Store sandbox |
| 98 | +(and will therefore only be useful in limited scenarios, like as a remoting client to manage other machines.) |
| 99 | + |
| 100 | +Furthermore, this will never be supported on Windows 7 or Server 2008R2, and so it's a lower priority. |
0 commit comments