如何在CentOS 8上安装PowerShell
admin
2023-08-01 01:28:51
0

terminal-linux-logo-1terminal-linux-logo-1在CentOS 8上安装PowerShell

步骤1.首先,让我们首先确保您的系统是最新的。

sudo clean all
sudo dnf update

步骤2.在CentOS 8上安装PowerShell。

适用于Linux的PowerShell已发布到官方的Microsoft存储库中,以便于安装和更新。

  • 使用RPM软件包安装PowerShell:

现在,我们将使用以下命令添加正式的Microsoft存储库:

curl https://packages.microsoft.com/config/rhel/7/prod.repo | sudo tee /etc/yum.repos.d/microsoft.repo

然后,运行以下命令以安装PowerShell:

sudo dnf install powershell

安装后,使用以下命令启动PowerShell:

root@idroot ~]# pwsh
  • 从Github安装PowerShell:

现在运行以下命令从Github安装PowerShell :

sudo dnf install https://github.com/PowerShell/PowerShell/releases/download/v7.0.3/powershell-7.0.3-1.centos.8.x86_64.rpm

一旦安装成功,这就是PowerShell的基本用法:

root@idroot ~]# pwsh
PowerShell 7.0.3
Copyright (c) Microsoft Corporation. All rights reserved.

https://aka.ms/powershell
Type \'help\' to get help.

PS /root># display Cmdlet list (only display 10 lines from the head)
PS /root> (Get-Command)[0..9]
CommandType     Name                                               Version    Source
-----------     ----                                               -------    ------
Function        cd..
Function        cd\\
Function        Clear-Host
Function        Compress-Archive                                   1.2.5      Microsoft.PowerShell.Archive
Function        Configuration                                      2.0.5      PSDesiredStateConfiguration
Function        Expand-Archive                                     1.2.5      Microsoft.PowerShell.Archive
Function        Find-Command                                       2.2.4.1    PowerShellGet
Function        Find-DSCResource                                   2.2.4.1    PowerShellGet
Function        Find-Module                                        2.2.4.1    PowerShellGet
Function        Find-RoleCapability                                2.2.4.1    PowerShellGet

恭喜你!您已经成功安装了PowerShell。感谢您使用本教程在CentOS 8系统上安装PowerShell Microsoft。有关其他帮助或有用信息,我们建议您检查PowerShell的官方网站。

相关内容

热门资讯

Windows 11 和 10... Windows 11/10 文件夹属性中缺少共享选项卡 – 已修复 1.检查共享选项卡是否可用 右键...
Radmin VPN Wind... Radmin VPN 是一款免费且用户友好的软件,旨在牢固地连接计算机以创建一个有凝聚力的虚拟专用网...
如何修复 Steam 内容文件... Steam 内容文件锁定是当您的 Steam 文件无法自行更新时出现的错误。解决此问题的最有效方法之...
在 Windows 11 中打... 什么是链路状态电源管理? 您可以在系统控制面板的电源选项中看到链接状态电源管理。它是 PCI Exp...
事件 ID 7034:如何通过... 点击进入:ChatGPT工具插件导航大全 服务控制管理器 (SCM) 负责管理系统上运行的服务的活动...
Hive OS LOLMine... 目前不清退的交易所推荐: 1、全球第二大交易所OKX欧意 国区邀请链接: https://www.m...
在 iCloud 上关闭“查找... 如果您是 Apple 的长期用户,您肯定会遇到过 Find My 应用程序,它本机安装在 iPhon...
iPhone 屏幕上有亮绿色斑... iPhone 是市场上最稳定的智能手机之一,这主要归功于专为它们设计的 iOS 操作系统。然而,他们...
balenaEtcher烧录后... balenaEtcher烧录后u盘或者内存卡无法识别不能使用的解决方法想要恢复原来的方法,使用win...
farols1.1.501.0... faro ls 1.1.501.0(64bit)可以卸载,是一款无需连接外部PC机或笔记本计算机即可...