Skip to content

Instantly share code, notes, and snippets.

@MyITGuy
Last active November 1, 2023 18:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MyITGuy/8600589 to your computer and use it in GitHub Desktop.
Save MyITGuy/8600589 to your computer and use it in GitHub Desktop.
PowerShell: Output Example
$OutputObjects = New-Object -TypeName PSObject
$OutputObjects = @()
$Objects = Get-CimInstance -Class Win32_Service
foreach ($Object In $Objects) {
$Name = $Object.Name
$OutputObject = New-Object -TypeName PSObject -Property @{
Name = $Name
};
$OutputObjects += $OutputObject
}
$OutputObjects
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment