Powershell: Can't install PowerShell 6.1 preview

Created on 19 Jun 2018  路  3Comments  路  Source: PowerShell/PowerShell

I need to run Test-NetConnection but from what I have seen I need to install PowerShell 6.1 for this to work. When I install PowerShell 6.1 Preview on Mac and try run the pwsh command it doesn't work.

Steps to reproduce

Install PowerShell using package [powershell-6.1.0-preview.3-osx-x64.pkg](https://github.com/PowerShell/PowerShell/releases/download/v6.1.0-preview.3/powershell-6.1.0-preview.3-osx-x64.pkg)

Installation successful and can be found in the following location:

/usr/local/microsoft/powershell/6-preview

Expected behavior

PowerShell v6.1.0-Preview
Copyright (c) Microsoft Corporation. All rights reserved.

(I'm not entirely sure if this is the exact expected behaviour)

Actual behavior

-bash: pwsh: command not found

Environment data

$PSVersionTable will not run
Issue-Question Resolution-Answered

Most helpful comment

pwsh - it is for release
pwsh-preview - it is for preview version.

If you install preview package you should use pwsh-preview.
This is implemented we have release and preview version side-by-side.

Also currently PowerShell Core has ported Test-Connection cmdlet (experimental).

All 3 comments

@adampember The app that is installed has the incorrect link. To work-around:

Open terminal

cd /Applications/PowerShell.app/Contents/MacOS
sudo chmod -777 PowerShell.sh

Edit PowerShell.sh and change the contents from:

#!/bin/bash
open /usr/local/bin/pwsh

to

#!/bin/bash
open /usr/local/bin/pwsh-preview

Save the file, and you should be able to launch PowerShell

pwsh - it is for release
pwsh-preview - it is for preview version.

If you install preview package you should use pwsh-preview.
This is implemented we have release and preview version side-by-side.

Also currently PowerShell Core has ported Test-Connection cmdlet (experimental).

Thank you for your replies. I can confirm pwsh-preview has worked!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rkeithhill picture rkeithhill  路  3Comments

aragula12 picture aragula12  路  3Comments

garegin16 picture garegin16  路  3Comments

andschwa picture andschwa  路  3Comments

pcgeek86 picture pcgeek86  路  3Comments