From the course: PowerShell for SQL Server Administration

Unlock the full course today

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

Parameters in PowerShell

Parameters in PowerShell - PowerShell Tutorial

From the course: PowerShell for SQL Server Administration

Start my 1-month free trial

Parameters in PowerShell

- [Instructor] So one of the things we've used in our example script so far is some Parameters. And we've already used those in our demos. We're already seen them. Let's talk about them for a quick second so we can see exactly what these parameters are. So parameters can be used to send different values into cmdlets or into functions. So when you're creating Powershell code the easiest thing to do is going to be to wrap things in functions. And so when you call them you then call that function that you pass in a set of parameters. So be it a cmdlet or a function we're always going to want to send it in parameters. Cause that's going to give it different values that we're going to be able to use as you pass things in. So parameters can be different types of data. Some are going to be text, some just strings. Some are going to be different kinds of objects. When it comes to those other kinds of objects the easiest way to deal with those is going to be either to pass those in from a…

Contents