Building Your First PowerShell Function
Lab
Intermediate
0 h 25 m
2020-07-02
Lab Overview
Building Your First PowerShell Function Overview In this lab, you will create your first PowerShell function. You will learn not only how to create a function but when you should create a function. You will also learn how to load your functions into a PowerShell session and how to invoke it.

Related Learning Path(s):
Getting Started with PowerShell 7
Objectives
  • Understand when it may be beneficial to create functions
  • Recognize patterns to choose good times to create functions
  • Create a simple function
  • Dot-source a PowerShell script
  • Call a function
Exercises
In this exercise, you will learn how to notice patterns to determine when you should create a function.
In this exercise, you will learn how write a function from existing code that does not have any parameters.
In this exercise, you will learn how to call a function with PowerShell by dot-sourcing a script.
In this exercise, you will learn how to create a function with parameters to customize input to a function.
Real-Time Lab
Not Registered?
Create Account
Already Registered?
Login
What are Labs?

Labs provide a live environment to get hands-on experience using the same tools and services in the real world.


Learn More