From the course: PowerShell 7 Essential Training

Unlock the full course today

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

Parameter attributes for scripts and functions

Parameter attributes for scripts and functions - PowerShell Tutorial

From the course: PowerShell 7 Essential Training

Start my 1-month free trial

Parameter attributes for scripts and functions

- [Instructor] Now, when working with PowerShell, there are various parameters and attributes that we can utilize when writing our own scripts and functions. PowerShell functions allow easy reuse and save time. Each function can then contain variables, existing commands, and reuse other functions. Functions are also a core building block for creating PowerShell scripts. One of the first options that we have is to utilize arguments. Now, you may have seen arguments being used in old PowerShell or in batch files where you basically execute a command and then pass in various values after the command. So for example, if it's powershell.exe, space, and then a couple of values that tend to be in quotes, that would be an argument. And they are retrieved starting at zero, one, two, three, four, et cetera. Arguments are not declared at the function level whatsoever, and you can utilize multiple arguments within a…

Contents