Building PowerShell Objects
One reason that PowerShell is so valuable to IT professionals is that a great deal of work went into it to take advantage of the .NET Framework but not require PowerShell users to be .NET developers. The PowerShell team also went to great lengths to abstract a lot of the .NET "sausage-making" so that you could focus on being productive.
We all know about PowerShell's object-centered nature. But what you may not be aware of, or give much thought to, is how these objects are presented to you. You've heard me say, "Everything in PowerShell is an object." But where does that object come from? I wanted to spend a little time exploring the nature of objects in PowerShell. If nothing else, this should give you a better understanding of why PowerShell behaves the way it does. Some of you might devise ways to leverage this information. But don't worry. I'll share some code that I use that illustrates this knowledge's power.
Let’s begin with an object.
$file = Get-Item c:\windows\notepad.exe