Skip to main content

Quiz - Module 8: PowerShell & Registry

Test your knowledge on PowerShell and the Windows Registry!


Question 1​

What is the extension for PowerShell scripts?

  • A) .bat
  • B) .ps1
  • C) .cmd
  • D) .exe
See the answer

Answer: B) .ps1

PowerShell scripts use the .ps1 extension.


Question 2​

Which command lists files in PowerShell?

  • A) dir
  • B) Get-ChildItem or ls
  • C) list
  • D) show
See the answer

Answer: B) Get-ChildItem or ls

Get-ChildItem (alias: ls, dir, gci) lists items.


Question 3​

How do you display help for a cmdlet?

  • A) help cmdlet
  • B) Get-Help cmdlet
  • C) cmdlet /?
  • D) man cmdlet
See the answer

Answer: B) Get-Help cmdlet

Get-Help Get-Process displays detailed help.


Question 4​

Which cmdlet displays running processes?

  • A) Show-Process
  • B) Get-Process
  • C) List-Process
  • D) Find-Process
See the answer

Answer: B) Get-Process

Get-Process (alias: ps, gps) lists processes.


Question 5​

Which cmdlet stops a process?

  • A) Kill-Process
  • B) Stop-Process
  • C) End-Process
  • D) Remove-Process
See the answer

Answer: B) Stop-Process

Stop-Process -Name notepad stops Notepad.


Question 6​

What is the pipeline in PowerShell?

  • A) A file
  • B) Passing the output of one cmdlet to the input of another
  • C) A virus
  • D) A type of variable
See the answer

Answer: B) Passing the output to the input of another cmdlet

The pipe | allows chaining cmdlets.


Question 7​

How do you filter results with a condition?

  • A) Filter
  • B) Where-Object or Where
  • C) Find
  • D) Search
See the answer

Answer: B) Where-Object or Where

Get-Process | Where-Object {$_.CPU -gt 10} filters by CPU.


Question 8​

What does $_ represent in PowerShell?

  • A) The current directory
  • B) The current object in the pipeline
  • C) An error
  • D) The last result
See the answer

Answer: B) The current object in the pipeline

$_ (or $PSItem) references the item being processed.


Question 9​

Which cmdlet selects specific properties?

  • A) Get-Property
  • B) Select-Object
  • C) Show-Property
  • D) Find-Property
See the answer

Answer: B) Select-Object

Get-Process | Select-Object Name, CPU selects columns.


Question 10​

Which cmdlet exports to a CSV file?

  • A) Save-CSV
  • B) Export-Csv
  • C) Write-CSV
  • D) Out-CSV
See the answer

Answer: B) Export-Csv

Get-Process | Export-Csv processes.csv exports to CSV.


Question 11​

What is the Windows Registry?

  • A) A text file
  • B) The hierarchical database of system settings
  • C) A browser
  • D) A protocol
See the answer

Answer: B) The hierarchical database of system settings

The Registry stores Windows and application configurations.


Question 12​

Which command opens the Registry Editor?

  • A) registry
  • B) regedit
  • C) config
  • D) settings
See the answer

Answer: B) regedit

regedit opens the graphical Registry Editor.


Question 13​

Which hive contains the current user's settings?

  • A) HKEY_LOCAL_MACHINE
  • B) HKEY_CURRENT_USER
  • C) HKEY_CLASSES_ROOT
  • D) HKEY_USERS
See the answer

Answer: B) HKEY_CURRENT_USER

HKCU contains the logged-in user's settings.


Question 14​

Which hive contains global system settings?

  • A) HKEY_CURRENT_USER
  • B) HKEY_LOCAL_MACHINE
  • C) HKEY_USERS
  • D) HKEY_CURRENT_CONFIG
See the answer

Answer: B) HKEY_LOCAL_MACHINE

HKLM contains settings applicable to all users.


Question 15​

Where are startup programs in the Registry?

  • A) HKCU\Software
  • B) HKCU\Software\Microsoft\Windows\CurrentVersion\Run
  • C) HKLM\System
  • D) HKCR\Run
See the answer

Answer: B) HKCU\Software\Microsoft\Windows\CurrentVersion\Run

The Run key contains programs launched at startup.


Question 16​

Which cmdlet reads a Registry value?

  • A) Read-Registry
  • B) Get-ItemProperty
  • C) Show-Registry
  • D) Find-Registry
See the answer

Answer: B) Get-ItemProperty

Get-ItemProperty -Path "HKCU:\Software\..." reads values.


Question 17​

Which cmdlet modifies a Registry value?

  • A) Write-Registry
  • B) Set-ItemProperty
  • C) Change-Registry
  • D) Update-Registry
See the answer

Answer: B) Set-ItemProperty

Set-ItemProperty modifies Registry values.


Question 18​

What is an environment variable?

  • A) A virus
  • B) A system variable accessible by all programs
  • C) A temporary file
  • D) A protocol
See the answer

Answer: B) A system variable accessible by all programs

Environment variables store paths, global settings.


Question 19​

How do you display environment variables in CMD?

  • A) env
  • B) set
  • C) var
  • D) show
See the answer

Answer: B) set

set displays all environment variables.


Question 20​

How do you access PATH in PowerShell?

  • A) $PATH
  • B) $env:PATH
  • C) %PATH%
  • D) Get-Path
See the answer

Answer: B) $env:PATH

$env:PATH accesses the PATH environment variable.


Question 21​

What is AMSI?

  • A) A virus
  • B) Antimalware Scan Interface
  • C) A browser
  • D) A protocol
See the answer

Answer: B) Antimalware Scan Interface

AMSI allows antivirus to scan PowerShell/script content.


Question 22​

Which execution policy allows all scripts?

  • A) Restricted
  • B) Unrestricted
  • C) AllSigned
  • D) RemoteSigned
See the answer

Answer: B) Unrestricted

Set-ExecutionPolicy Unrestricted allows all scripts (risky!).


Question 23​

Which execution policy is the most secure?

  • A) Unrestricted
  • B) Restricted
  • C) Bypass
  • D) RemoteSigned
See the answer

Answer: B) Restricted

Restricted prevents the execution of any script.


Question 24​

Which cmdlet displays services?

  • A) Show-Service
  • B) Get-Service
  • C) List-Service
  • D) Find-Service
See the answer

Answer: B) Get-Service

Get-Service lists all Windows services.


Question 25​

Which cmdlet starts a service?

  • A) Run-Service
  • B) Start-Service
  • C) Begin-Service
  • D) Init-Service
See the answer

Answer: B) Start-Service

Start-Service -Name "name" starts a service.


Question 26​

How do you create a variable in PowerShell?

  • A) var x = 5
  • B) $x = 5
  • C) set x = 5
  • D) define x = 5
See the answer

Answer: B) $x = 5

PowerShell variables start with $.


Question 27​

Which cmdlet displays the content of a file?

  • A) Show-File
  • B) Get-Content
  • C) Read-File
  • D) Open-File
See the answer

Answer: B) Get-Content

Get-Content file.txt (alias: cat, gc, type) displays content.


Question 28​

Which cmdlet writes to a file?

  • A) Write-File
  • B) Set-Content or Out-File
  • C) Save-File
  • D) Put-File
See the answer

Answer: B) Set-Content or Out-File

Set-Content or Out-File write to files.


Question 29​

How do you run a PowerShell script?

  • A) run script.ps1
  • B) .\script.ps1
  • C) exec script.ps1
  • D) start script.ps1
See the answer

Answer: B) .\script.ps1

The .\ indicates the current directory to execute.


Question 30​

Which cmdlet tests a network connection?

  • A) Ping
  • B) Test-Connection
  • C) Check-Network
  • D) Try-Ping
See the answer

Answer: B) Test-Connection

Test-Connection google.com is the PowerShell equivalent of ping.


Score​

ScoreLevel
27-30Excellent!
22-26Very good!
17-21Good
12-16Fair
0-11Needs review

Module 8 Quiz - PowerShell & Registry - 30 questions