PowerShell
Posted: 26 May 2021, 06:45
PowerShell has a had a cross-platform, open source version for awhile. Can we get it deployable?
Bug Reports, Operation Guides, and Experience Sharing
https://forum.terra-master.com/en/
Code: Select all
sudo mv curl-amd64 /usr/local/bin/curl
sudo chmod +x /usr/local/bin/curlCode: Select all
# Download the powershell '.tar.gz' archive
curl -L -o /tmp/powershell.tar.gz https://github.com/PowerShell/PowerShell/releases/download/v7.1.3/powershell-7.1.3-linux-x64.tar.gz
# Create the target folder where powershell will be placed
sudo mkdir -p /opt/microsoft/powershell/7
# Expand powershell to the target folder
sudo tar zxf /tmp/powershell.tar.gz -C /opt/microsoft/powershell/7
# Set execute permissions
sudo chmod +x /opt/microsoft/powershell/7/pwsh
# Create the symbolic link that points to pwsh
sudo ln -s /opt/microsoft/powershell/7/pwsh /usr/bin/pwshCode: Select all
[admin@TNAS ~]$ pwsh
PowerShell 7.1.3
Copyright (c) Microsoft Corporation.
https://aka.ms/powershell
Type 'help' to get help.
PS /home/admin> get-process | sort-object CPU -descending | select -first 10
NPM(K) PM(M) WS(M) CPU(s) Id SI ProcessName
------ ----- ----- ------ -- -- -----------
0 0.00 0.00 15,111.31 6550 0 md1_raid5
0 0.00 0.00 3,220.34 6580 0 md1_resync
0 0.00 0.00 1,611.27 933 0 kswapd0
0 0.00 30.57 1,315.79 32365 …55 smbd
0 0.00 47.78 1,052.33 14022 …63 Plex Media Server
0 0.00 0.00 664.34 1853 0 kworker/1:1H-kblockd
0 0.00 0.00 648.47 1843 0 kworker/0:1H-kblockd
0 0.00 0.00 408.11 10 0 rcu_sched
0 0.00 0.13 307.26 4467 …66 syscontrol
0 0.00 46.12 196.98 20695 …63 Plex Script Hos