踩了无数的坑,安照下面的方法是能使用了。
ps:fedora28只能安装PowerShell Core 6.1及以上的版本!!!!
# Register the Microsoft signature key
sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
# Register the Microsoft RedHat repository
curl https://packages.microsoft.com/config/rhel/7/prod.repo | sudo tee /etc/yum.repos.d/microsoft.repo
# Update the list of products
sudo dnf update
# Install a system component
sudo dnf install compat-openssl10
# Install PowerShell
sudo dnf install -y powershell
# Start PowerShell
pwsh
在ubuntu、RHEL上安装可以看以下连接
很不幸我安装完又出现了问题是这样的:
pwsh
PowerShell v6.0.1
Copyright (c) Microsoft Corporation. All rights reserved.
https://aka.ms/pscore6-docs
Type 'help' to get help.
FailFast: The terminfo database is invalid.
at System.Environment.FailFast(System.String, System.Exception)
at System.Environment.FailFast(System.String, System.Exception)
at Microsoft.PowerShell.UnmanagedPSEntry.Start(System.String, System.String[], Int32)
at Microsoft.PowerShell.ManagedPSEntry.Main(System.String[])
Aborted (core dumped)
解决方法看下面的连接:
https://github.com/PowerShell/PowerShell/issues/6132
到此为止我的pwsh可以顺利运行起来了,祝你们好运