Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to display the PowerShell version.
PowerShell
Write-Output $PSVersionTable.PSVersion[1] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using .Minor or .Build instead of .Major
Forgetting the dot before the property name
✗ Incorrect
The $PSVersionTable.PSVersion.Major property shows the major version number of PowerShell.
2fill in blank
mediumComplete the code to get the list of running processes in PowerShell.
PowerShell
Get-[1] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using Get-Services instead of Get-Process
Confusing Jobs or Events with processes
✗ Incorrect
Get-Process is the correct cmdlet to list running processes.
3fill in blank
hardFix the error in the code to list all files in a folder.
PowerShell
Get-ChildItem -Path [1] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using forward slashes instead of backslashes
Adding a trailing slash which can cause issues
✗ Incorrect
In PowerShell, backslashes \ are used for Windows paths. The path should not end with a slash for this command.
4fill in blank
hardFill both blanks to create a hashtable with keys and values.
PowerShell
$info = @{ [1] = 'PowerShell'; [2] = 7 } Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using unrelated keys like Power or Level
Mixing up keys and values
✗ Incorrect
The keys Name and Version describe the hashtable content clearly.
5fill in blank
hardFill all three blanks to filter processes with CPU usage greater than 100.
PowerShell
$highCPU = Get-Process | Where-Object { $_.[1] [2] [3] } Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using
Name instead of CPUUsing wrong comparison operators
Using strings instead of numbers
✗ Incorrect
The property CPU is compared with > to the number 100 to filter processes using more CPU time.