GitHub link to my scrips here: https://github.com/PhysioFred/PowerShell-Scripts

If you’re a Linux user diving into PowerShell for Active Directory (AD) management, you’ll be pleased to know PowerShell supports many Linux-like aliases. This makes it easier to transition from the Linux command line to PowerShell.

Common PowerShell Aliases for Linux Users

Linux CommandPowerShell AliasDescription
lsls or Get-ChildItemLists files and directories
catcat or Get-ContentDisplays file contents
cdcd or Set-LocationChanges directory
cpcp or Copy-ItemCopies files and directories
mvmv or Move-ItemMoves or renames files
rmrm or Remove-ItemRemoves files and directories
echoecho or Write-OutputPrints text to the console

Quick Exercises to Get Comfortable with PowerShell

I use these exercise as these are common practice accross all scripting and programming langauges.

Exercise 1: Basic Variable Creation

  • Create string variables $userFirstName and $userLastName, and concatenate them to form $userFullName.
  • Convert $userFullName to uppercase and print it.

Exercise 2: Working with Numbers

  • Define numeric variables $userAge and calculate $yearsToRetirement based on a retirement age of 65.
  • Increment $userAge and decrement $yearsToRetirement to simulate a passing year.

Exercise 3: Arrays and Manipulation

  • Create an array $usernames with values like “jdoe”, “asmith”, “bwayne”.
  • Print each username, add “tstark” to the array, remove “asmith”, and print the updated array.

Exercise 4: Using Loops in PowerShell

  • Create a ForEach loop to iterate through the $usernames array.
  • For each username, print a message saying, “Processing user: [username].”

Why These Exercises?

I use Active Directory in my job so I want to learn to use it without having to use the GUI all the time so I can eventually write scripts and automate.