After installing (via https://github.com/PowerShell/PowerShell) PowerShell Alpha 9 to the latest version RC you receive the message powershell: command not found.
The first thing I did to troubleshoot this issue was remove all of the PowerShell versions as I saw two installations in the /usr/local/microsoft/powershell folder. I chose to run this command:
sudo rm -rf /usr/local/bin/pwsh /usr/local/microsoft/powershell
Then I installed PowerShell via brew by running the following command: brew cask install powershell
Again I got the message powershell: command not found.
So I cd’ed into the folder /usr/local/Microsoft/powershell/6.0.0-rc/ and ran the pwsh command. PowerShell started successfully!
Ok, so the problem is probably in the symbolic link, cd to the folder /usr/local/bin and execute
ls -la power* lrwxr-xr-x 1 username wheel 56 25 aug 2016 powershell /usr/local/microsoft/powershell/6.0.0-alpha.9/powershell
aha that’s the issue.
First run unlink powershell and check with ls -la power* if it successfully removed the symbolic link. If it’s removed then run the following command:
sudo ln -s /usr/local/microsoft/powershell/6.0.0-rc/pwsh /usr/local/bin/powershell