Another Way to Create NoteProperty Entries

We’ve seen the Select-Object synthetic property method and the Add-Member -name AddNoteProperty method, but here’s probably the most straightforward way to output object data. $object = $true | Select ComputerName, Path, ContentCount;$object.ComputerName =$env:COMPUTERNAME.ToLower();$object.Path =Get-Location;$object.ContentCount = (Get-ChildItem).Count;$object; This works because the first line creates an object with the NoteProperty properties we need.  When we Select-Object on…

0