Complete the code to add a new property 'Age' with value 30 to the object $person.
$person | Add-Member -MemberType NoteProperty -Name 'Age' -Value [1]
The -Value parameter sets the value of the new property. Here, 30 is the correct value to add.
Complete the code to add a property 'City' with value 'Seattle' to the object $employee.
$employee | Add-Member -MemberType [1] -Name 'City' -Value 'Seattle'
NoteProperty is used to add a simple property with a fixed value to an object.
Fix the error in the code to add a property 'Department' with value 'HR' to $staff.
$staff | Add-Member -MemberType NoteProperty -Name [1] -Value 'HR'
The -Name parameter expects the property name as a string, so it must be quoted.
Fill both blanks to add a property 'Salary' with value 50000 to $worker.
$worker | Add-Member -MemberType [1] -Name [2] -Value 50000
Use NoteProperty as the member type and quote the property name 'Salary'.
Fill all three blanks to add a property 'Title' with value 'Manager' to $employee.
$employee | Add-Member -MemberType [1] -Name [2] -Value [3]
Use NoteProperty for the member type, quote the property name 'Title', and quote the value 'Manager'.