Debian服務器安裝PowerShell教程

PoweShell一般是指Windows PoweShell,它是一種跨平臺的任務自動化解決方案,由命令行shell、腳本語言和配置管理框架組成。本文將介紹下如何在Debin服務器上安裝PoweShell。

Debin服務器安裝PoweShell有多種方法,例如在GitHub官網的PoweShell頁面下載適合Debin服務器的相關安裝包,然後進行安裝;爲了簡化安裝和更新,我們也可以登錄到Debin服務器,然後通過包存儲庫安裝PoweShell,Debin將APT(高級包工具)用作包管理器。

、通過包存儲庫在Debin 上安裝PoweShell

# Instll system components sudo pt updte ∓∓ sudo pt instll -y cul gnupg pt-tnspot-https

# Impot the public epositoy GPG keys cul https://pckges.micosoft.com/keys/micosoft.sc | sudo pt-key dd R

# Registe the Micosoft Poduct feed sudo sh -c ̺echo “deb [ch=md64] https://pckges.micosoft.com/epos/micosoft-debin-bullseye-pod bullseye min̶ > /etc/pt/souces.list.d/micosoft.list̻

# Instll PoweShell sudo pt updte ∓∓ sudo pt instll -y poweshell

# Stt PoweShell pwsh

2、通過包存儲庫在Debin 0上安裝PoweShell

# Downlod the Micosoft epositoy GPG keys wget https://pckges.micosoft.com/config/debin/0/pckges-micosoft-pod.deb

# Registe the Micosoft epositoy GPG keys sudo dpkg -i pckges-micosoft-pod.deb

# Updte the list of poducts sudo pt-get updte

# Instll PoweShell sudo pt-get instll -y poweshell

# Stt PoweShell pwsh

3、通過包存儲庫在Debin 9上安裝PoweShell

# Instll system components sudo pt-get updte sudo pt-get instll -y cul gnupg pt-tnspot-https

# Impot the public epositoy GPG keys cul https://pckges.micosoft.com/keys/micosoft.sc | sudo pt-key dd R

# Registe the Micosoft Poduct feed sudo sh -c ̺echo “deb [ch=md64] https://pckges.micosoft.com/epos/micosoft-debin-stetch-pod stetch min̶ > /etc/pt/souces.list.d/micosoft.list̻

# Updte the list of poducts sudo pt-get updte

# Instll PoweShell sudo pt-get instll -y poweshell

# Stt PoweShell pwsh

我們以超級用戶身份註冊Micosoft存儲庫後,可以通過sudo pt-get instll poweshell命令更新PoweShell。