From the course: PowerShell for SQL Server Administration

Unlock the full course today

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

Declaring objects

Declaring objects - PowerShell Tutorial

From the course: PowerShell for SQL Server Administration

Start my 1-month free trial

Declaring objects

- [Narrator] So when you're creating PowerShell, and when you start writing PowerShell and actually using variables and using objects, one of the first things you're going to discover really fast is that we have to create objects in PowerShell. So what are these objects that we're creating? And when do we need to create them? So, basically when we use create an object is whenever a cmdlet has output, and when we want to then use that output for something else we're going to need to declare that as a variable to hold that object. So basically, any time a variable is going to hold something that's going to end up being an object. So we're going to use objects very, very quickly when we're using PowerShell because we're going to need variables to actually do things. So what kind of objects are we going to create? So in short, Powershell's going to be non-object specific, non-type specific. So everything we run is going to have a different kind of output that we're going to have. So…

Contents