Installation (PowerShell Core): Difference between revisions

From vwiki
Jump to navigation Jump to search
(Created page with "Allows you to run PowerShell Core from a Linux host or AWS Lambda .NET Core 2.1 runtime. Note that it is a significantly cut down environment from what you'd expect when runn...")
 
(Added Windows install)
Line 1: Line 1:
Allows you to run PowerShell Core from a Linux host or AWS Lambda .NET Core 2.1 runtime.  Note that it is a significantly cut down environment from what you'd expect when running within a Windows OS.  Part of the power of PowerShell is that it makes anything that's exposed through .NET available to PowerShell, but where this is dependant on Windows libraries, then its obviously not going to be available in Core (cryptography for example).
Allows you to run PowerShell Core from a Linux or macOS host or even AWS Lambda .NET Core 2.1 runtime (as well on a Windows machine).  Note that it is a significantly cut down environment from what you'd expect when running within a Windows OS.  Part of the power of Windows PowerShell is that it makes anything that's exposed through the full .NET Framework is available to PowerShell, but much of this is specific to Windows.  PowerShell Core is dependant on .NET Core, which is stripped down so that it can run on more platforms.  This does cause some gotchas, for example cryptography is not available in .NET Core, therefore you can't create secure strings (which you'd normally use for handling passwords).


== Procedure ==  
== Procedure ==  
=== Linux ===
These instructions are for Ubuntu 16.04 LTS, but can be adapted for other versions as indicated, for other distributions see https://docs.microsoft.com/en-us/powershell/scripting/setup/installing-powershell-core-on-linux?view=powershell-6 for further info.  The procedure below has been tested on both Ubuntu 14.04 and 16.04.
These instructions are for Ubuntu 16.04 LTS, but can be adapted for other versions as indicated, for other distributions see https://docs.microsoft.com/en-us/powershell/scripting/setup/installing-powershell-core-on-linux?view=powershell-6 for further info.  The procedure below has been tested on both Ubuntu 14.04 and 16.04.


Line 14: Line 15:
# Launch PowerShell
# Launch PowerShell
#* <code> pwsh </code>
#* <code> pwsh </code>
=== Windows ===
Can be installed side by side with Windows PowerShell.
# Download latest win-x64.msi package from https://github.com/PowerShell/PowerShell/releases
# Install downloaded package


[[Category:PowerShell Core]]
[[Category:PowerShell Core]]
[[Category:Linux]]
[[Category:Linux]]
[[Category:Ubuntu]]
[[Category:Ubuntu]]

Revision as of 13:04, 12 October 2018

Allows you to run PowerShell Core from a Linux or macOS host or even AWS Lambda .NET Core 2.1 runtime (as well on a Windows machine). Note that it is a significantly cut down environment from what you'd expect when running within a Windows OS. Part of the power of Windows PowerShell is that it makes anything that's exposed through the full .NET Framework is available to PowerShell, but much of this is specific to Windows. PowerShell Core is dependant on .NET Core, which is stripped down so that it can run on more platforms. This does cause some gotchas, for example cryptography is not available in .NET Core, therefore you can't create secure strings (which you'd normally use for handling passwords).

Procedure

Linux

These instructions are for Ubuntu 16.04 LTS, but can be adapted for other versions as indicated, for other distributions see https://docs.microsoft.com/en-us/powershell/scripting/setup/installing-powershell-core-on-linux?view=powershell-6 for further info. The procedure below has been tested on both Ubuntu 14.04 and 16.04.

  1. Register Microsoft repository GPG key
  2. Add the Microsoft repository to aptitude sources (change the MS URL to fix your OS version)
  3. Update list of available packages
    • apt update
  4. Install PowerShell Core
    • apt install powershell
  5. Launch PowerShell
    • pwsh

Windows

Can be installed side by side with Windows PowerShell.

  1. Download latest win-x64.msi package from https://github.com/PowerShell/PowerShell/releases
  2. Install downloaded package