0
0
PowerShellscripting~10 mins

Select-Object for properties in PowerShell - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to select only the 'Name' property from the process list.

PowerShell
Get-Process | Select-Object [1]
Drag options to blanks, or click blank then click option'
A-ExpandProperty Name
B-InputObject Name
C-Property Name
D-Filter Name
Attempts:
3 left
💡 Hint
Common Mistakes
Using '-ExpandProperty' instead of '-Property' when you want to keep the property as an object.
Using '-InputObject' which is not valid here.
Using '-Filter' which is not a parameter for Select-Object.
2fill in blank
medium

Complete the code to select the 'Id' property from the process list.

PowerShell
Get-Process | Select-Object [1]
Drag options to blanks, or click blank then click option'
A-Property Id
B-Filter Id
C-InputObject Id
D-ExpandProperty Id
Attempts:
3 left
💡 Hint
Common Mistakes
Using '-ExpandProperty' which extracts the value instead of keeping it as a property.
Using '-InputObject' or '-Filter' which are not valid parameters here.
3fill in blank
hard

Fix the error in the code to select the 'CPU' property from the process list.

PowerShell
Get-Process | Select-Object [1]
Drag options to blanks, or click blank then click option'
A-Filter CPU
B-ExpandProperty CPU
C-InputObject CPU
D-Property CPU
Attempts:
3 left
💡 Hint
Common Mistakes
Using '-ExpandProperty' which returns only the value, not an object with property.
Using '-InputObject' or '-Filter' which are invalid here.
4fill in blank
hard

Fill both blanks to select 'Name' and 'Id' properties from the process list.

PowerShell
Get-Process | Select-Object [1] [2]
Drag options to blanks, or click blank then click option'
A-Property Name
B-Property Id
C-ExpandProperty Name
D-ExpandProperty Id
Attempts:
3 left
💡 Hint
Common Mistakes
Using '-ExpandProperty' which only works for one property at a time.
Mixing '-Property' and '-ExpandProperty' in the same command.
5fill in blank
hard

Fill all three blanks to select 'Name', 'Id', and 'CPU' properties from the process list.

PowerShell
Get-Process | Select-Object [1] [2] [3]
Drag options to blanks, or click blank then click option'
A-Property Name
B-Property Id
C-Property CPU
D-ExpandProperty CPU
Attempts:
3 left
💡 Hint
Common Mistakes
Using '-ExpandProperty' which only works for one property and returns values, not objects.
Mixing '-Property' and '-ExpandProperty' in the same command.