Skip to content

Latest commit

 

History

History
31 lines (17 loc) · 966 Bytes

File metadata and controls

31 lines (17 loc) · 966 Bytes

Adding Power with Functions

Functions allow you to group Powershell statements and enable you to not only combine these statements but also call them from different environments, if they are configured properly. The extra power comes from the fact that you can essentially create new cmdlets and persist them in scripts or in something called PowerShell profile and run them from anywhere either as a script, call them from other scripts or from the command line across all sessions.

Before we do this though we need to learn about a couple of other Powershell elements first.

  • Powershell Profile
  • Powershell Modules

What is a PowerShell profile

What is a PowerShell module

Creating a Powershell profile

Writing a function

Using functions

Section targets

  • Define PowerShell functions
  • Understand what PS-Profile and PS-Modules have to do with functions
  • Create a profile
  • Create a function
  • Call functions in different ways.