Functions are flexible and useful for a variety of tasks in PowerShell. In this video, we'll take a look at how to create a basic function and call it from the command line.
- [Voiceover] Let's start taking a look…at some of the additional functionality…that PowerShell can give you.…Now one of the things you may have noticed…when I ran Get Command, in an earlier video,…I had these commands,…I mean they're at the very top, and you can see them,…they flash by really quick, called Functions.…Now, Functions actually provides…some useful capabilities inside of PowerShell.…Now we see them just as commandlets,…and we actually access them…just like we would any other commandlets,…and we see, Set Network, Adapter,…or Set Net Adapter, or Set File Share,…you see all these different things.…And for us they are functions,…and that's how we work with them,…and how we call them.…
In reality, underneath the cover,…functions actually have a wide variety…of commands that they actually do and run,…for us.…So you don't really have to worry so much…about the built in functions,…'cause you work with them…just like any other commandlet.…However, you can also make your own functions…that perform a variety of tasks.…
Matt then dives into PowerShell's functions and What If statements, working with output, and coding in the Integrated Scripting Environment (ISE). The course wraps up with some tips on using PowerShell for both on-premises and cloud deployments involving Office 365 and Azure.
- Identify the purpose of a delimiter.
- Recognize the tools needed to build a command using the ISE.
- Identify the options to use when running Get-Service from a remote computer.
- Recognize the capabilities of four cmdlets.
- Explain how to transfer aliases from a file into PowerShell.
- Determine if a cmdlet will generate an error when executed.