Ubuntu 21.10にpowershellをインストールする方法

環境
OSバージョンの確認

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=21.10
DISTRIB_CODENAME=impish
DISTRIB_DESCRIPTION="Ubuntu 21.10"
# cat /etc/lsb-release DISTRIB_ID=Ubuntu DISTRIB_RELEASE=21.10 DISTRIB_CODENAME=impish DISTRIB_DESCRIPTION="Ubuntu 21.10"
# cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=21.10
DISTRIB_CODENAME=impish
DISTRIB_DESCRIPTION="Ubuntu 21.10"

操作方法
1.snapからpowershellをインストールします

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# sudo snap install powershell --classic
powershell 7.2.2 from Microsoft PowerShell? installed
# sudo snap install powershell --classic powershell 7.2.2 from Microsoft PowerShell? installed
# sudo snap install powershell --classic
powershell 7.2.2 from Microsoft PowerShell? installed

2.powershellのインストールを確認します

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# powershell
PowerShell 7.2.2
Copyright (c) Microsoft Corporation.
https://aka.ms/powershell
Type 'help' to get help.
PS /root>
# powershell PowerShell 7.2.2 Copyright (c) Microsoft Corporation. https://aka.ms/powershell Type 'help' to get help. PS /root>
# powershell
PowerShell 7.2.2
Copyright (c) Microsoft Corporation.

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

PS /root>

3.ヘルプコマンドの確認

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
PS /root> Get-Help
TOPIC
PowerShell Help System
SHORT DESCRIPTION
Displays help about PowerShell cmdlets and concepts.
PS /root> Get-Help TOPIC PowerShell Help System SHORT DESCRIPTION Displays help about PowerShell cmdlets and concepts. 略
PS /root> Get-Help

TOPIC
PowerShell Help System

SHORT DESCRIPTION
Displays help about PowerShell cmdlets and concepts.
略

 

Ubuntu 21.10

Posted by arkgame