Skip to content

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.
  • Labs icon Lab
  • A Cloud Guru
Google Cloud Platform icon
Labs

PowerShell Core Cmdlets in Linux

There are a few commands every PowerShell user should know. These commands help make everyday tasks easier and are some of the key building blocks in learning PowerShell. While we will cover other cmdlets in this lab, the three most important cmdlets every PowerShell user should master are `Get-Help`, `Get-Command`, and `Get-Service`.

Google Cloud Platform icon
Labs

Path Info

Level
Clock icon Beginner
Duration
Clock icon 45m
Published
Clock icon Apr 24, 2020

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.

Table of Contents

  1. Challenge

    Perform a system update, register the MS RedHat repository, and install PowerShell

    1. Use the yum command to sync the package index files from their sources via the Internet:
    sudo yum check-update
    
    1. Use the yum command to install the newest versions of all installed packages on CentOS:
    sudo yum update
    
    1. Register the Microsoft RedHat Repository
    curl https://packages.microsoft.com/config/rhel/7/prod.repo | sudo tee /etc/yum.repos.d/microsoft.repo
    
    1. Install PowerShell:
    sudo yum install -y powershell
    
    1. Start PowerShell:
    pwsh
    
  2. Challenge

    Work with the Get-Command, Get-Help, and Get-Process Cmdlets

    1. Get all of the commands in the current session:
    Get-Command
    
    1. Get a list of all aliases in the current session using Get-Command:
    Get-Command -CommandType Alias
    
    1. Get a list of all functions in the current session using Get-Command:
    Get-Command -CommandType Function
    
    1. Access the help documentation for the Get-Command cmdlet:
    Get-Help Get-Command
    
    1. Update the help documentation:
    Update-Help
    
    1. Get a list of examples for using the Get-Command cmdlet:
    Get-Help Get-Command -Examples
    
    1. Gets a list of all cmdlets, sorts them alphabetically by the noun in the cmdlet name, and then display them in noun-based groups. Use the pipeline with the cmdlets:
    Get-Command -Type Cmdlet | Sort-Object -Property Noun | Format-Table -GroupBy Noun
    
    1. Get a list of all currently running process on the CentOS system:
    Get-Process
    
    1. List processes on the CentOS system in groups based on priority:
    $A = Get-Process
    $A | Get-Process | Format-Table -View priority
    
    1. Exit PowerShell:
    exit
    

The Cloud Content team comprises subject matter experts hyper focused on services offered by the leading cloud vendors (AWS, GCP, and Azure), as well as cloud-related technologies such as Linux and DevOps. The team is thrilled to share their knowledge to help you build modern tech solutions from the ground up, secure and optimize your environments, and so much more!

What's a lab?

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Provided environment for hands-on practice

We will provide the credentials and environment necessary for you to practice right within your browser.

Guided walkthrough

Follow along with the author’s guided walkthrough and build something new in your provided environment!

Did you know?

On average, you retain 75% more of your learning if you get time for practice.

Start learning by doing today

View Plans