PowerShell: System.Object or PSObject? -


i have started using custom objects inside few of powershell scripts. upon looking around online noticed there 2 ways create these objects

$obj1 = new-object system.object $obj2 = new-object psobject 

they both have functionality needed, such setting custom properties necessary information held.

my question is, there necessary time use 1 of them on other? found article on technet seems heading in right direction giving answer question, haven't been able wrap mind around it. link below.

https://social.technet.microsoft.com/forums/scriptcenter/en-us/dcfa43ba-812f-4274-b5b2-caa0e2d56988/psobject-vs-systemobject?forum=itcg

thanks!

i able find answers in article linked below.

custom-object-gotchas

as side note, answer looking seems psobject not limited system.object in terms of using them .net functions. system.object not pass custom properties .net functions psobject will


Comments

Popular posts from this blog

javascript - Create a stacked percentage column -

Optimising Firebase database by automatically overwriting data -

javascript - Angular UI-Grid customTemplate directive causing rows to load slowly/? -