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.
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
PowerShell v6.1.0-Preview
Copyright (c) Microsoft Corporation. All rights reserved.
(I'm not entirely sure if this is the exact expected behaviour)
-bash: pwsh: command not found
$PSVersionTable will not run
@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!
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-Connectioncmdlet (experimental).