From the course: Learning PowerShell Core

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Functions

Functions - PowerShell Tutorial

From the course: Learning PowerShell Core

Start my 1-month free trial

Functions

- [Tutor] You've been running commands a lot in this course. You've been running other people's commands. It's now time to build your own commands, also known as functions. Functions are the building blocks of PowerShell. They allow developers to compartmentalize code and reuse that code. Once you get more acclimated to PowerShell code you'll find yourself not writing code line by line, but writing code that calls your existing functions, saving you loads of time not having to recreate the wheel. So first off let's see how many different kinds of commands I have available to me already in my default installation of PowerShell Core. So I can do that by running Get-Command. Get-Command, as you probably know by now, returns all those different commands available to us. I can use the Group-Object command to group all those by the command type, which you can see here I have Alias, Functions, and Cmdlet, so 840 functions, 352…

Contents