We may earn an affiliate commission when you visit our partners.
Course image
David Fitzpatrick

Have you always found PowerShell and scripting intimidating, but you have always wanted to learn how to automate using PowerShell?

Read more

Have you always found PowerShell and scripting intimidating, but you have always wanted to learn how to automate using PowerShell?

This course is meant for the complete non-programming beginner who wants to know about PowerShell and some cool scripting with PowerShell. We will start at the beginning, using PowerShell Cmdlets and then moving on to scripting in which those same Cmdlets can and will be used.

This course is intended for people who don’t know how to program or script and want to learn how to not only use PowerShell one-liners in the shell, but also have always wanted to learn how to script but never thought they could.

We will go through the material step by step, starting at Cmdlets and parameters, filtering properties and moving on to scripting, using if/elsif/else statements, using arrays with foreach loops and combining it all plus much more. Everything is done step by step. No knowledge is assumed and no steps omitted and it is going to be fun, which is important to keep learning.

At the end you should know how to use PowerShell, using its Cmdlets and knowing how to do very effective PowerShell scripting .

Welcome to PowerShell from Beginner to Sheller and Scripter.

Enroll now

What's inside

Learning objectives

  • You will be able to use powershell cmdlets and use nice 'one-liners' and create your own!
  • You will be able to automate tasks
  • You will understand what variables are
  • You will understand how to create a powershell script from the ground up
  • You will understand if statements
  • You will understand what arrays are
  • You will understand loops like while and foreach

Syllabus

Getting to know about the prerequisites, PowerShell and what we can use PowerShell for

Introduction. Also don't forget to check out the bonus video!

Read more
The fun stuff you will learn
What and why of PowerShell - Module 0
Introduction to Module 0
M0 : What is PowerShell and PowerShell versions
M0 : Why PowerShell and examples
M0 : Word of note
All about PowerShell Cmldets and writing beautiful one-liners
M1 : Module 1 introduction
  • Starting the PowerShell shell

  • Using the PowerShell shell

  • Why we already know PowerShell

  • What are Cmdlets ?

  • Using Cmdlets and parameters 

  • What are properties ? Do not belong to Cmdlets


  • EXAMPLES:

  • Get-Service 

  • Stop-Service 

  • Start-Service 


  • Looking online

  • Get-LocalUser

  • Set-LocalUser

  • To quote or not to quote

  • Using Help with Cmdlets using the Cmdlet Get-Help to get the parameters and values it needs.

  • Using the internet to find out about Cmdlets

  • Updating help with Update-Help

  • How do you find the right Cmdlet for the job to do ?

  • Is it Set-LocalUser or Disable-LocalUser for disabling a local user ?

  • What are modules ?

  • Using Get-Command

  • What is the PowerShell pipeline ?


  • EXAMPLES:

  • Get-Service –Name ‘spooler’ | Stop-Service 

  • Get-Service –Name ‘spooler’ | Start-Service 

  • Get-LocalUser –Name ‘Dave’ | Set-LocalUser –Description ‘My Lovely Account’


  • What is the PowerShell pipeline ?


  • EXAMPLES:

  • Get-Item -Path ’C:\Source\1.txt' (Retrieve one item) 

  • Copy-Item -Path 'C:\Source\1.txt' -Destination 'C:\Target'

  • Get-Item -Path ’C:\Source\1.txt'  | Copy-Item -Destination 'C:\Target'


  • What is the PowerShell pipeline ?


  • EXAMPLES:

  • Get-ChildItem -Path ’C:\Source' (Retrieve all items in a directory) 

  • Get-ChildItem -Path ’C:\Source'  | Copy-Item -Destination 'C:\Target'


  • How do we output to a text file ?


  • EXAMPLES:

  • Get-Service | Out-File –FilePath ‘c:\test\services.txt’ 

  • Look at properties again and why parameters are not properties.

  • Drop a word called ‘object’ on you and see how you respond

  • How do we format data in PowerShell ?


  • EXAMPLES:

  • Get-Service | Format-List –Property

  • Get-Service | Format-Table –Property

  • Get-Service | Format-Table –Autosize | Out-File –FilePath ‘C:\test\test.txt’



M1 : Lab 1 Challenge
M1 : Lab 1 Solution
  • PowerShell Objects a deeper look what they are and where they come from !

  • How can we find out the properties and methods of an object?


  • EXAMPLES:

  • Get-Service | Get-Member

  • Get-LocalUser | Get-Member


  • How can we find out the kind of properties of an object?


  • EXAMPLES:

  • Get-Service | Get-Member

  • How can we find out the kind of parameters we need ?


  • EXAMPLES:

  • Get-Service


  • How can we find out the kind of parameters we need ?


  • EXAMPLES:

  • Get-Service

How can we get only the stuff we need based on a property of an object ?



EXAMPLES:

Get-Service | Where-Object {$PSItem.status –eq ‘running’} | Out-File –FilePath  ‘C:\reports\report.txt’




How can we get only the stuff we need based on a property of an object ?



EXAMPLES:

Get-LocalUser | Where-Object {$PSItem.enabled –eq $false} | Set-LocalUser `  –Description ‘Disabled Account’


  • How do we select specific information ?


  • EXAMPLES:

  • Get-Service | Select-Object –First 5

  • Get-Service | Select-Object –Last 5

  • Get-Service | Select-Object –Property name,status –First 5 | Out-File –FilePath ‘C:\test\services.txt’




  • How can we group in alphabetical order or from high to low and vice versa?


  • EXAMPLES:

  • Get-Service | Sort-Object –Property ‘Status’



  • How can we output to CSV in a simple way ?

  • Getting it all together + some gotchas

M1 : Lab 2 Challenge
M1 : Lab 2 Solution
M1 : Lab 3 Challenge
M1 : Lab 3 Solution
  • A nice Mini Challenge to think about!

  • A nice Mini Challenge to think about...again!

How to write versatile scripts in PowerShell that will make your life easier and look like a superstar !
  • Moving on to a script

  • What is a PowerShell script ?

  • Using and exploring the PowerShell ISE (Integrated Scripting Environment)

  • Running a small script

  • Set-ExecutionPolicy

  • Writing our first PowerShell Script “Hello Wonderful People!”

  • Variables in PowerShell

  • What is a variable ?

  • Defining a variable in PowerShell

  • Different types of variables in PowerShell (DataTypes) and why important ?

  • Example string,int,datetime and many many more.

  • Integer (int)

  • String (str or text)

  • Boolean (bool)

  • DateTime (Store Date)


  • Using [string]$DogType or [int]$Number to tell PowerShell what datatype you want.

  • Using $MyVariable.GetType() to see what kind of variable you have.

  • Getting data from the user using Read-Host.

  • Using this data in a PowerShell Script.

  • What are Arythmic Operators ?

  • + Add, - Subtract, * Multiply, / Divide, % Mod(Remainder)


M2 : Lab 1 Challenge
M2 : Lab 1 Solution
  • Objects 2 the return of the killer object…

  • Putting an object into a variable and using its properties and methods, more specifically it is an instance from a command.


  • EXAMPLES:

  • $Service = Get-Service –Name ‘spooler’

  • $Service | Get-Member

  • How to use If Statement to make decisions in your script

  • Creating multiple decisions in your script with If/ElseIf/Else Statement

  • And some gotchas


  • If/Elseif/Else statement.


  • Scripting Example : if a local user is enabled, disable it and if a local user is disabled enable it.

  • STEPS:

  • Which Cmdlets do I need ? Look at the  internet to find out.

  • Which Parameters of Cmdlets am I going to use ?

  • What variables am I going to use.

  • Which properties of the object which is in the variable do I need and what are the possible values of the properties.



  • If/Elseif/Else statement. And some extra tips and tricks added continuing part 3!


  • Scripting Example : if a local user is enabled, disable it and if a local user is disabled enable it.

  • STEPS:

  • Which Cmdlets do I need ? Look at the  internet to find out.

  • Which Parameters of Cmdlets am I going to use ?

  • What variables am I going to use.

  • Which properties of the object which is in the variable do I need and what are the possible values of the properties.


  • If/Elseif/Else statement. And let's make a sentence continuing part 4!


  • Scripting Example : if a local user is enabled, disable it and if a local user is disabled enable it.

  • STEPS:

  • Which Cmdlets do I need ? Look at the  internet to find out.

  • Which Parameters of Cmdlets am I going to use ?

  • What variables am I going to use.

  • Which properties of the object which is in the variable do I need and what are the possible values of the properties.

  • Nested If/ElseIf/Else statement.

  • Continuing Nesting If/ElseIf/Else statement. (That bird doesn't have it easy)


M2 : Lab 2 Challenge
M2 : Lab 2 Solution
  • What are comparison operators ?

  • What are logical operators ?

  • Are you ready to program the next gaming sensation ?

M2 : Shall we play a game ?? Guess my number part 1 Solution
  • Explanation of what a loop is and what a While loop does

M2 : Lab 4 Solution
M2 : Lab 3 Challenge
M2 : Lab 3 Solution
M2 : Shall we play a game ?? Guess my number part 2
M2 : Shall we play a game ?? Guess my number part 2 Solution
M2 : Shall we play a game ?? Guess my number part 3 Solution
  • PowerShell Arrays

  • Indexing in an Array


  • Using the Foreach to loop through a PowerShell array

  • PowerShell Arrays with LocalUsers

  • Indexing in an Array with LocalUsers

  • Using the Foreach to loop through a PowerShell array of Local User Objects


  • Using a combination Foreach and If

  • Mmmm nothing more descriptive to add here

M2 : Lab 4 Challenge
M2 : Shall we play a game ?? Guess my number part 4 Solution
  • Creating Local Users from a simple text file

  • Creating Directories or files from a simple text file

  • Well...just in case you didn't know how

  • Using and exploring the Import-Csv Cmdlet

  • Using the Import-Csv Cmdlet to create Local Users

M2 : Lab 5 Challenge
M2 : Lab 5 Solution
  • You will need to finish the set up lab environment to follow along, or use your own setup

  • Moving to Active Directory

  • Creating an Active Directory User with PowerShell

  • Since the Active Directory Cmdlets are tricky, I have added them here in the scripting part

  • Moving to Active Directory

  • Retrieving a user in Active Directory

  • Since the Active Directory Cmdlets are tricky, I have added them here in the scripting part

  • Moving to Active Directory

  • Set AD user properties

  • Since the Active Directory Cmdlets are tricky, I have added them here in the scripting part

  • Moving to Active Directory

  • Creating an Organizational Unit

  • Move Active Directory users from one OU to another OU

  • Selecting more Active Directory Users with Where-Object

  • Nothing more to add here, except that maybe you can do this yourself and then watch the video!

  • Just create a file with some names and add them to Active Directory in any OU you want !

  • Again, nothing more to add here, except that maybe you can do this yourself and then watch the video!

  • Just import a CSV file we created earlier for the Local Users!

M2 : Lab 6 Challenge
M2 : Lab 6 Solution

Good to know

Know what's good
, what to watch for
, and possible dealbreakers
Teaches foundational PowerShell from the ground up
Suitable for beginners to PowerShell and scripting
Provides lessons in a step-by-step manner
Course materials are comprehensive, covering topics from Cmdlets and parameters to scripting
Covers essential concepts such as variables, arrays, and loops
May require additional resources for advanced learners seeking more in-depth knowledge

Save this course

Save PowerShell from Beginner To Sheller And Scripter to your list so you can find it easily later:
Save

Activities

Be better prepared before your course. Deepen your understanding during and after it. Supplement your coursework and achieve mastery of the topics covered in PowerShell from Beginner To Sheller And Scripter with these activities:
Seek Guidance from Experienced PowerShell Users
Connect with PowerShell experts who can provide you with valuable advice and support.
Show steps
  • Identify potential mentors in your professional network or online communities.
  • Reach out to them and request guidance.
  • Attend their webinars or workshops.
Join a PowerShell Study Group
Connect with other learners, share knowledge, and get support in your PowerShell journey.
Show steps
  • Find a PowerShell study group online or in your local area.
  • Attend the group meetings regularly.
  • Participate in discussions and ask questions.
Follow the Microsoft Learn PowerShell Tutorial
Gain a solid understanding of PowerShell basics and its practical applications.
Show steps
  • Visit the Microsoft Learn website for PowerShell tutorial.
  • Follow the step-by-step instructions and complete all the modules.
  • Experiment with the provided code examples.
Four other activities
Expand to see all activities and additional details
Show all seven activities
Solve PowerShell Challenges on HackerRank
Test your PowerShell skills and improve your problem-solving abilities.
Show steps
  • Create an account on HackerRank.
  • Browse the PowerShell challenges.
  • Attempt to solve the challenges using PowerShell.
Read 'Powershell in Action'
Learn about the fundamentals of PowerShell and how to use it for automation and scripting tasks.
Show steps
  • Purchase or borrow the book.
  • Read the first three chapters.
  • Try out the examples in the book.
Automate a Task with PowerShell
Apply your PowerShell knowledge to a real-world scenario by automating a task.
Show steps
  • Identify a task that you want to automate.
  • Write a PowerShell script to automate the task.
  • Test and refine your script.
Contribute to Open Source PowerShell Projects
Gain practical experience and learn from others by contributing to open source PowerShell projects.
Show steps
  • Find open source PowerShell projects on GitHub or other platforms.
  • Identify an area where you can contribute.
  • Fork the project and make your changes.
  • Create a pull request and contribute your changes.

Career center

Learners who complete PowerShell from Beginner To Sheller And Scripter will develop knowledge and skills that may be useful to these careers:

Reading list

We haven't picked any books for this reading list yet.

Share

Help others find this course page by sharing it with your friends and followers:

Similar courses

Here are nine courses similar to PowerShell from Beginner To Sheller And Scripter.
Formatting Data in PowerShell
Most relevant
PowerShell: Getting Started
Most relevant
Bash Shell Scripting: From Zero To Automation
Most relevant
Bash Shell Scripting Tutorial for Beginners
Most relevant
Master Microsoft PowerShell
Most relevant
Getting Started with PowerShell Core on Linux and macOS
Most relevant
Bash Scripting and Shell Programming (Linux Command Line)
Most relevant
Getting Started with PowerShell Scripting
Most relevant
Working with Data in PowerShell
Most relevant
Our mission

OpenCourser helps millions of learners each year. People visit us to learn workspace skills, ace their exams, and nurture their curiosity.

Our extensive catalog contains over 50,000 courses and twice as many books. Browse by search, by topic, or even by career interests. We'll match you to the right resources quickly.

Find this site helpful? Tell a friend about us.

Affiliate disclosure

We're supported by our community of learners. When you purchase or subscribe to courses and programs or purchase books, we may earn a commission from our partners.

Your purchases help us maintain our catalog and keep our servers humming without ads.

Thank you for supporting OpenCourser.

© 2016 - 2024 OpenCourser