Complete the code to get the type of an object in PowerShell.
$obj = Get-Process
$obj.[1]The GetType() method returns the type of the object, showing PowerShell treats output as objects.
Complete the code to access the 'Id' property of a process object.
$proc = Get-Process -Name notepad
$proc.[1]The Id property holds the process ID, showing how PowerShell objects have properties you can access directly.
Fix the error in the code to call the 'ToString()' method on an object.
$obj = Get-Date
$obj.[1]Methods require parentheses to be called. ToString() correctly calls the method.
Fill both blanks to create a custom object with properties 'Name' and 'Age'.
$person = [PSCustomObject]@{
Name = [1]
Age = [2]
}We create a custom object with Name 'Alice' and Age 30 using a hashtable.
Fill all three blanks to filter processes with CPU usage greater than 1 and select their names.
Get-Process | Where-Object { $_.[1] [2] [3] } | Select-Object NameThis filters processes where the CPU property is greater than 1, showing object property filtering.