Skip to content

Instantly share code, notes, and snippets.

@IT-Delinquent
Created June 24, 2021 09:11
Show Gist options
  • Select an option

  • Save IT-Delinquent/4b0f2fbbbfeecc7b32b2145ad07e4cce to your computer and use it in GitHub Desktop.

Select an option

Save IT-Delinquent/4b0f2fbbbfeecc7b32b2145ad07e4cce to your computer and use it in GitHub Desktop.
personModelListInPowerShell
#Creating a list to hold the people using the Person class
$People = New-Object 'System.Collections.Generic.List[PSObject]'
#Creating a new Person
$newPerson = [PersonClass]::new()
$newPerson.Name = "Roy Orbison"
$newPerson.Age = "24"
#Adding the new Person to the People list $People.Add($newPerson)
$People.Add($newPerson)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment