PowerShell tutorial : Chapter 1 – Beginning with PowerShell

fig : PowerShell - "Windows PowerShell ISE" - executing first CMDLET - Get-Help
fig : PowerShell - "Windows PowerShell ISE" - executing first CMDLET - Get-Help

Hi All,

Greetings for the day!!!

We are continuing PowerShell tutorial. Today we will discuss some basics about PowerShell

Take away from this article – At the end of this article you will got to know about

  • What is PowerShell
  • What are PowerShell CMDLETs
  • To whom for PowerShell
  • PowerShell features
  • Why to use PowerShell
  • PowerShell tools
  • Writing our first PowerShell – Getting started

What is PowerShell

  • Microsoft defines PowerShell – PowerShell is a cross-platform task automation solution made up of a
    • command-line shell
    • a scripting language and
    • a configuration management framework
  • PowerShell runs on Windows, Linux, and macOS
  • PowerShell is commonly used for automating the management of systems
  • PowerShell accepts and returns .NET objects. It works objects over texts
  • PowerShell is built on .NET Common Language Runtime (CLR)
  • Commands for PowerShell are known as CMDLETs(pronounced command-lets)

PowerShell CMDLETs

  • Commands for PowerShell are known as CMDLETs(pronounced command-lets)
  • PowerShell module is the collection of PowerShell CMDLETs
  • PowerShell uses a Verb-Noun name pair to name cmdlets
  • Examples
    • Get-Help – Here,
      • Verb – Get : what action needs to perform and
      • Noun – Help : resource on which CMDLET perform its actions

PowerShell features

  • Very good command-line history
  • Intellisense – Tab completion
  • Pipeline for chaining commands
  • PowerShell scripting language is extensible through functions, classes, scripts and modules
  • PowerShell scripting have built-in support for common data formats like CSV, JSON and XML
  • Easy output formatting
  • Built-in help system – Provides detailed information about commands and also integrate online help articles
  • Aliases –
    • Aliases are alternate names that can be used to run CMDLETS
    • PowerShell supports the use of common aliases such as cls (clear the screen) and ls (list the files)
    • This helps users from other frameworks and helps to remember PowerShell name for there familiar commands

To whom for PowerShell

  • Basically for all kind of administrators
  • System administrators
  • Cloud administrators (In case of Microsoft – Azure Administrator, Azure AD Administrator, SharePoint Online Administrators, Exchange Administrators and so on)
  • Developers
  • Deployment team
  • Even for QAs as well for testing purpose

Why to use PowerShell

  • To build, test and deploy the solutions and mostly in CI/CD environments
  • PowerShell helps to automate administrative tasks
  • To manage cloud – To manage cloud resources. Get / Update / Deploy – cloud resources
    • Creating users in Microsoft 365
    • Creating groups in Azure AD and so on
  • CI / CD – used as part of a Continuous Integration/Continuous Deployment pipeline
  • This list is very long, we will be keep exploring in upcoming articles of tutorial

PowerShell tools

Writing our first PowerShell – Getting started

  • We could see all PowerShell releases at – https://github.com/PowerShell/PowerShell/releases
  • There are lots of available PowerShell CMDLETs we can use or we can write script as well as per our need
  • Today as a first PowerShell CMDLET, I’ll discuss Get-Help CMDLET
  • I’ll use Windows PowerShell ISE
  • Following are the steps

STEP 1 – Choose the tool to execute CMDLET / write Script – Open the PowerShell ISE

fig : PowerShell - Opening "Windows PowerShell ISE"
fig : PowerShell – Opening “Windows PowerShell ISE”
  • As PowerShell ISE opens it looks like as below
  • There are two panes to – PowerShell ISE
    • Script Pane
    • Console
PowerShell - "Windows PowerShell ISE"
fig : PowerShell – “Windows PowerShell ISE”

Step 2 – In console window use CMDLET – Get-Help as

Get-Help 

fig : PowerShell - "Windows PowerShell ISE" - executing first CMDLET - Get-Help
fig : PowerShell – “Windows PowerShell ISE” – executing first CMDLET – Get-Help
  • Get-Help – Displays information about PowerShell commands and concepts.

fig : PowerShell - "Windows PowerShell ISE" - executing first CMDLET - Get-Help
fig : PowerShell – “Windows PowerShell ISE” – executing first CMDLET – Get-Help

REFERENCES

Prasham Sabadra

LIFE IS VERY BEAUTIFUL. ENJOY THE WHOLE JOURNEY :) Founder of Microsoft 365 Junction, Speaker, Author, Learner, Developer, Passionate Techie. Certified Professional Workshop Facilitator / Public Speaker. Believe in knowledge sharing. Around 20+ years of total IT experience and 17+ years of experience in SharePoint and Microsoft 365 services Please feel free me to contact for any SharePoint / Microsoft 365 queries. I am also very much interested in behavioral (life changing) sessions like motivational speeches, Success, Goal Setting, About Life, How to live Life etc. My book - Microsoft 365 Power Shell hand book for Administrators and Beginners and 100 Power Shell Interview Questions - https://www.amazon.in/Microsoft-Administrators-Beginners-Interview-Questions/dp/9394901639/ref=tmm_pap_swatch_0?_encoding=UTF8&qid=1679029081&sr=8-11

You may also like...

1 Response

  1. December 31, 2023

    […] a comprehensive guide on PowerShell, check out the tutorial article available here. It’s a valuable resource to enhance your PowerShell […]

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from Microsoft 365

Subscribe now to keep reading and get access to the full archive.

Continue reading