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

Published by Xajuan Smith

Computer Information Specialist, with a desire to make the masses feel what I was born to channel...The emotion that strives us to do more, speak more boldly and with most sincere ideals that will make life easier and will not hinder the dreams we all have at any given time.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

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

%d bloggers like this: