Install PowerShell In Centos 8 Stream/CWP/AlmaLinux/RockyLinux/OracleLinux/EL8/EL7
In this tutorial we’ll Lear How you can easily install PowerShell in Centos 7/Centos 8 Stream/CWP Linux server PowerShell is a cross-platform task automation solution made up of a command-line shell, a scripting language, and a configuration management framework. PowerShell runs on Windows, Linux, and macOS.
Command-line Shell
PowerShell is a modern command shell that includes the best features of other popular shells. Unlike most shells that only accept and return text, PowerShell accepts and returns .NET objects. The shell includes the following features:
- Robust command-line history
- Tab completion and command prediction
- Supports command and parameter aliases
- Pipeline for chaining commands
- In-console help system, similar to Unix man pages
Centos 7/EL7 :
curl https://packages.microsoft.com/config/rhel/7/prod.repo | sudo tee /etc/yum.repos.d/microsoft.repo yum clean all yum install -y powershell
Centos 8 Stream/CWP/AlmaLinux/RockyLinux/OracleLinux/EL8 :
curl https://packages.microsoft.com/config/rhel/8/prod.repo | sudo tee /etc/yum.repos.d/microsoft.repo yum clean all yum install -y powershell
To run the PowerShell just run this command :
pwsh
example :
[root@centos]# pwsh PowerShell 7.2.1 Copyright (c) Microsoft Corporation. https://aka.ms/powershell Type 'help' to get help. PS /root>