0
0
PowerShellscripting~5 mins

PowerShell on Linux - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is PowerShell on Linux?
PowerShell on Linux is a cross-platform command-line shell and scripting language that works on Linux, macOS, and Windows. It lets you automate tasks and manage systems using the same commands and scripts across different operating systems.
Click to reveal answer
beginner
How do you install PowerShell on a Linux system like Ubuntu?
You can install PowerShell on Ubuntu by running these commands:<br>
sudo apt update<br>sudo apt install -y wget apt-transport-https software-properties-common<br>wget -q https://packages.microsoft.com/config/ubuntu/22.04/packages-microsoft-prod.deb<br>sudo dpkg -i packages-microsoft-prod.deb<br>sudo apt update<br>sudo apt install -y powershell
<br>Then start PowerShell by typing pwsh.
Click to reveal answer
beginner
How do you start PowerShell on Linux after installation?
Open your terminal and type pwsh then press Enter. This launches the PowerShell shell where you can run PowerShell commands and scripts.
Click to reveal answer
intermediate
Can PowerShell scripts written on Windows run on Linux without changes?
Most PowerShell scripts run on Linux without changes because PowerShell is cross-platform. However, scripts that use Windows-specific features like Windows Registry or Windows-only cmdlets may need adjustments.
Click to reveal answer
beginner
What is a simple PowerShell command to list files in the current directory on Linux?
Use Get-ChildItem or its alias ls to list files and folders in the current directory. For example:<br>
Get-ChildItem
<br>This works similarly on Linux and Windows.
Click to reveal answer
Which command starts PowerShell on a Linux terminal?
Abash
Bpowershell.exe
Cpwsh
Dsh
What package manager command is used to install PowerShell on Ubuntu?
Aapt install powershell
Byum install powershell
Cpacman -S powershell
Ddnf install powershell
Which of these is a PowerShell cmdlet to list directory contents?
Als -l
BGet-ChildItem
Cdir /w
Dcat
True or False: PowerShell on Linux supports Windows Registry commands.
AFalse
BOnly with special modules
COnly on Ubuntu
DTrue
What is the main benefit of PowerShell being cross-platform?
AIt replaces Bash on Linux.
BIt runs faster on Linux than Windows.
CIt only works on Linux servers.
DYou can use the same scripts on Windows, Linux, and macOS.
Explain how to install and start PowerShell on a Linux system.
Think about the commands you run in the terminal step by step.
You got /5 concepts.
    Describe the advantages and limitations of using PowerShell on Linux compared to Windows.
    Consider what works the same and what might be different.
    You got /4 concepts.