0
0
PowerShellscripting~10 mins

Why PowerShell exists - Test Your Understanding

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

Complete the code to display the PowerShell version.

PowerShell
Write-Output $PSVersionTable.PSVersion[1]
Drag options to blanks, or click blank then click option'
A.Minor
B.Revision
C.Build
D.Major
Attempts:
3 left
💡 Hint
Common Mistakes
Using .Minor or .Build instead of .Major
Forgetting the dot before the property name
2fill in blank
medium

Complete the code to get the list of running processes in PowerShell.

PowerShell
Get-[1]
Drag options to blanks, or click blank then click option'
AProcess
BServices
CJobs
DEvents
Attempts:
3 left
💡 Hint
Common Mistakes
Using Get-Services instead of Get-Process
Confusing Jobs or Events with processes
3fill in blank
hard

Fix 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'
AC:\Users\Public\
BC:/Users/Public
CC:\Users\Public
DC:/Users/Public/
Attempts:
3 left
💡 Hint
Common Mistakes
Using forward slashes instead of backslashes
Adding a trailing slash which can cause issues
4fill in blank
hard

Fill 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'
AName
BVersion
CPower
DLevel
Attempts:
3 left
💡 Hint
Common Mistakes
Using unrelated keys like Power or Level
Mixing up keys and values
5fill in blank
hard

Fill 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'
ACPU
B>
C100
DName
Attempts:
3 left
💡 Hint
Common Mistakes
Using Name instead of CPU
Using wrong comparison operators
Using strings instead of numbers