Technology & IT Skills
PowerShell quiz: fundamentals, cmdlets, and scripting basics
This PowerShell fundamentals quiz helps you check your grasp of core cmdlets, scripting patterns, and the pipeline. Answer 15 multiple-choice questions, see your score instantly, and spot topics to review. If you're expanding your developer toolkit, try the Git quiz or the .NET quiz next.
Take the Quiz
1Which cmdlet lists all available commands in the current PowerShell session?
2Which parameter displays what a cmdlet would do without making changes?
3What is the pipeline operator in PowerShell used to pass objects between commands?
4Which cmdlet shows detailed help for a specific cmdlet including examples?
5Which cmdlet reveals the properties and methods of objects flowing through the pipeline?
6Which comparison operator checks for pattern matching using regular expressions?
7What does the $_ automatic variable represent inside pipeline script blocks?
8How do you define a hashtable literal in PowerShell?
9Which redirection operator sends error output stream (stream 2) to a file?
10Aliases are fully equivalent to fun<wbr>ctions and can include parameter validation attributes.
11Which variable controls the default action when a non-terminating error occurs?
12Which feature lets a parameter accept input directly from the pipeline by property name?
13What is the correct syntax to execute a script in the current scope without creating a new scope?
14Select-Object can create calculated properties using hashtables with Name and Expression keys.
15Export-Csv includes type information by default unless -NoTypeInformation is used (Windows PowerShell behavior).
16Parameter sets allow mutually exclusive parameter combinations within a single fun<wbr>ction or cmdlet.
17Receive-Job -Keep leaves job data available for subsequent receives.
18The Debug and Verbose message streams are the same and controlled by the same preference variable.
19PowerShell 7 introduces pipeline chain operators && and || for conditional execution based on success.
20The S in CIM stands for Scriptable.
Learning Goals
Learning Outcomes
- Analyse basic PowerShell cmdlets and their uses
- Apply variables and data types in scripts
- Demonstrate pipeline operations for data processing
- Identify proper use of loops and conditional statements
- Evaluate error handling and debugging techniques
- Master module management and script execution policies
Study Guide
Cheat Sheet
- Master Essential PowerShell Cmdlets - Get-Help shows usage examples and syntax for any cmdlet, while Get-Command lets you explore available commands by verb or noun. Get-Member reveals object properties and methods so you can manipulate data confidently. Together, these cmdlets form the foundation of effective PowerShell scripting. PowerShell on Wikipedia
- Understand Variables and Data Types - Use the
$symbol to declare variables and assign values like strings, integers, and arrays to store information. Understanding PowerShell's dynamic typing and explicit type casting prevents common data mishaps. Mastering variables is crucial for building flexible, reusable scripts. PowerShell on Wikipedia - Utilize the Pipeline for Data Processing - The pipeline (
|) passes output of one cmdlet directly as input to another, letting you chain commands without creating temporary files. You can filter, sort, and format data on the fly using cmdlets like Where-Object, Sort-Object, and Format-Table. This streamlined approach is at the heart of PowerShell's data processing magic. PowerShell on Wikipedia - Implement Conditional Statements - Use
if,elseif, andelseblocks to control which sections of your script run based on specific criteria. Conditional logic allows your automation to make decisions - like checking if a service is running or if a file exists - before proceeding. Mastering conditionals means your scripts can react intelligently to different scenarios. Control Flow with Conditional Statements - Employ Looping Constructs - Loops such as
for,foreach, andwhilelet you perform repetitive tasks without duplicating code. Whether processing every file in a directory or iterating through a list of users, loops automate bulk operations efficiently. Learning which loop fits each scenario speeds up your scripts and keeps them neat. Looping Techniques in PowerShell - Handle Errors Gracefully - Encapsulate risky code in
try,catch, andfinallyblocks to capture and respond to exceptions, preventing script failures. You can log errors, retry operations, or clean up resources in a structured way, ensuring reliable automation. Good error handling also makes troubleshooting easier when things go wrong. Error Handling in PowerShell - Manage Modules Effectively - Import modules with
Import-Moduleto add new cmdlets and features from the PowerShell Gallery or custom scripts. Keeping modules up to date and removing unused ones streamlines your environment and avoids version conflicts. Understanding module scope and autoloading helps you manage dependencies cleanly. PowerShell Modules on Wikipedia - Understand Script Execution Policies - Execution policies like
Restricted,RemoteSigned, andUnrestrictedgovern which scripts can run on your system. By usingGet-ExecutionPolicyandSet-ExecutionPolicy, you balance security and flexibility. This knowledge protects your systems from untrusted code while allowing authorized automation. Execution Policies on Wikipedia - Explore Object-Oriented Features - PowerShell treats output as objects, letting you access properties and methods directly rather than parsing text. You can create custom objects, define classes, and overload methods to build advanced modules. Embracing these capabilities transforms scripts into modular, self-describing code. PowerShell Object Model
- Practice Debugging Techniques - Use
Set-PSBreakpointandGet-PSCallStackto set breakpoints and inspect call stacks, pinpointing errors in real time. Supplement withWrite-DebugandWrite-Verboseto output diagnostic messages without cluttering normal script output. Regular debugging drills sharpen your ability to find and fix issues swiftly. Debugging PowerShell Scripts
Explore More
Technology Quizzes
AI-DraftedHuman-Reviewed
Reviewed by
Updated Feb 20, 2026