Storing Objects and Text.

The best case scenario in my opinion of using variables is to leverage objects. I know some of the users prefer text only, but objects carry much more information, that can be logged or leveraged. Here is an example:

Having computer’s name vs and object with multiple properties.

the first 3 lines is easier to type, but less flexible.

The 3 last lines are are magic…

This is just scratching the surface

Having the same data in the variable and then manipulating them to give you what you want so that the data is applicable and even passed to more commands.

So lets say there is another propery or point of interest that needs to be associated with the computer and user….

Can you do that with text and then create a fancy excel sheet? maybe if you want to have panic attacks about deadlines. It is all about the objects of desire lol.

Lets add a serial number:

static data addition

Lets get Dynamic like a duo (no Microsoft pun) with dynamic Data

This object is now dynamic and can be used to extrapolate data inside of a remote script, report, or function.

Brain Check… share your real world applications of create dynamic and static objects.

If you cannot think of any then use the code to inventory your home PCs. Don’t forget to add the serial number:

Get-CimInstance Win32_bios

Don’t Forget to select the properties you need or expand them to just get the inside of the object.

Want to learn what is selectable with any object? Indicate the object and pipe it to get-member.

Get-CimInstance Win32_bios | get-member

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

  • Profiting by gaining everything!

    What does “having it all” mean to you? Is it attainable? What does it mean to have it all? To me, it means that we’re thinking about the projects that…

    ·

  • Leader in Following

    Are you a leader or a follower? I want you to read into this without reading too deeply. I believe good leaders are followers. So for most things in this…

    ·

  • Faded memories and logos

    What’s the oldest things you’re wearing today? So the oldest thing that I’m wearing today is actually my Samsung jacket, and it reminds me a lot of where I’ve come…

    ·

Spam-free subscription, we guarantee. This is just a friendly ping when new content is out.

Go back

Your message has been sent

Warning
Warning
Warning.