---
title: "PowerShell: Windows Scripting Fundamentals"
description: "Test your knowledge of PowerShell fundamentals with a quiz covering cmdlets, pipelines, objects, variables, execution policies, functions, scripting best practices, and Windows automation."
author: "Mohammad Abu Mattar"
canonical: https://mkabumattar.com/quizzes/post/powershell-scripting-fundamentals-quiz
---

# PowerShell: Windows Scripting Fundamentals

Welcome to the PowerShell Basics Quiz! This quiz covers fundamental PowerShell concepts, cmdlets, and scripting best practices. Each question is multiple-choice, and you'll find hints to help you along the way. Good luck!

## Questions

### 1. What is the standard Verb-Noun naming convention in PowerShell?

- `Action.Object`
- `Verb-Noun`
- `Command_Option`
- `Noun-Verb`

**Hint:** Think of a specific action applied to a specific object.

### 2. How do you define a variable in PowerShell?

- `var Name = "Value"`
- `$Name = "Value"`
- `set Name = "Value"`
- `@Name = "Value"`

**Hint:** Use the character associated with "Strings" and "Money".

### 3. What is the primary difference between the Bash pipe and the PowerShell pipe?

- PowerShell pipes only support Windows-based binary data
- Bash passes text strings, while PowerShell passes .NET Objects
- Bash pipes can handle larger files than PowerShell pipes
- PowerShell pipes require manual data type conversion

**Hint:** One passes text; the other passes "living" data.

### 4. Which cmdlet is used to filter objects based on specific criteria?

- `Select-Object`
- `Where-Object`
- `Filter-Item`
- `Match-Property`

**Hint:** Think: "Find items WHERE this condition is true".

### 5. What does the automatic variable "$_" represent?

- The result of the last failed system operation
- The current object being processed in the pipeline
- The exit code of the most recent console command
- The total count of items residing in a collection

**Hint:** It refers to the "Current" thing in the pipe.

### 6. Which comparison operator is used for "Not Equal"?

- `!=`
- `-ne`
- `-not`
- `-isnot`

**Hint:** PowerShell uses text-based operators prefixed with a hyphen.

### 7. What is the purpose of the "Get-Member" cmdlet?

- To list members of an Active Directory group
- To see the properties and methods available for an object
- To add a new member variable to a custom object
- To check the version of the PowerShell host

**Hint:** It "unwraps" an object to show you its properties and methods.

### 8. How do you check the execution policy of your system?

- `policy --status`
- `Get-ExecutionPolicy`
- `Set-ExecutionPolicy`
- `Show-ScriptPolicy`

**Hint:** You want to "Get" the "ExecutionPolicy".

### 9. What does the "RemoteSigned" execution policy mean?

- All scripts must be signed by a globally trusted CA
- Allows local scripts to run while requiring signatures for downloaded files
- Prevents all scripts from running regardless of origin
- Permits any script to execute without any security checks

**Hint:** It treats local and downloaded scripts differently.

### 10. What is a Hash Table in PowerShell?

- A sequential array of numeric data points
- A data structure used to store unique keys and values
- A method for encrypting sensitive script files
- A relational table stored within a database

**Hint:** A collection of Key-Value pairs.

### 11. How do you bypass a confirmation prompt when running a risky command?

- `-Suppress`
- `-Force`
- `-YesToAll`
- `-Silent`

**Hint:** Think "Force".

### 12. Which cmdlet is used to output text to the console with color options?

- `Write-Output`
- `Write-Host`
- `Out-Console`
- `New-Message`

**Hint:** You are "Writing" to the "Host".

### 13. What is "Splatting"?

- Removing all empty files from a directory
- Bundles command parameters into a single variable for easier execution
- Formatting a string by joining multiple values
- Separating a complex object into individual variables

**Hint:** Using a Hash Table to pass many parameters to a command at once.

### 14. What is the purpose of the "Get-Help" cmdlet?

- To perform an online search for shell errors
- To display documentation and examples for PowerShell commands
- To open a support ticket with the system vendor
- To automatically debug errors in a script file

**Hint:** The built-in documentation system.

### 15. Which symbol is used for comments in PowerShell?

- `//`
- `#`
- `--`
- `/*`

**Hint:** The same symbol used for hashtags.

### 16. What happens when you use the "Export-Csv" cmdlet?

- It creates a log of the current command history
- It saves PowerShell objects into a Comma Separated Values file
- It converts the session variables into a binary file
- It sends the current object to a remote web server

**Hint:** It converts objects into a spreadsheet-ready format.

### 17. How do you specify a data type for a variable (e.g., an Integer)?

- `[int]$Number = 5`
- `$Number:int = 5`
- `int $Number = 5`
- `$Number = 5 (int)`

**Hint:** Use square brackets before the variable name.

### 18. What does the "Test-Path" cmdlet do?

- It creates a new directory if one is missing
- It checks if a file or folder exists at a specific location
- It verifies the integrity of a system binary file
- It measures the latency to a specific network path

**Hint:** It returns a simple True or False.

### 19. Which cmdlet is used to download content from the web?

- `Get-WebContent`
- `Invoke-WebRequest`
- `Download-File`
- `Fetch-URL`

**Hint:** You "Invoke" a "WebRequest".

### 20. What is the "Pipeline" symbol in PowerShell?

- `>`
- `|`
- `&`
- `%`

**Hint:** The vertical bar.

### 21. What is a "Script Block" in PowerShell?

- A security mechanism that prevents unauthorized code execution
- A collection of statements that acts as a single functional unit
- A storage container for pre-compiled binary library references
- A temporary file used to store script execution logs

**Hint:** Code contained inside curly braces { }.

### 22. What is the purpose of the "-WhatIf" parameter?

- To prompt the user for confirmation before every action
- To describe what a command would do without actually performing it
- To provide a list of alternative cmdlets for a task
- To check if a script contains any structural syntax errors

**Hint:** It is the "Dry Run" mode.

### 23. Which cmdlet is used to restart a computer?

- `Stop-Computer`
- `Restart-Computer`
- `Reset-System`
- `New-Reboot`

**Hint:** Verb is "Restart", Noun is "Computer".

### 24. How do you create a new empty file in PowerShell?

- `Make-File filename.txt`
- `New-Item -Path "filename.txt" -ItemType File`
- `Create-Item filename.txt`
- `Set-Content filename.txt`

**Hint:** "New" + "Item".

### 25. What does the cmdlet "Get-Process" return?

- A list of all software installed on the hard drive
- Objects representing the programs currently running on the system
- A report on the health of the system CPU and RAM
- A chronological log of every command run in the shell

**Hint:** A list of "living" items on the computer.

### 26. How do you access the first item in an array named $List?

- `$List[1]`
- `$List[0]`
- `$List.First()`
- `$List{0}`

**Hint:** PowerShell is zero-indexed.

### 27. What is "PowerShell Core"?

- A legacy version designed for older Windows systems
- The cross-platform version of PowerShell built on .NET Core
- A high-performance version restricted to server hardware
- A cloud-only version used exclusively in Microsoft Azure

**Hint:** The version that runs on Mac and Linux.

### 28. Which cmdlet is used to rename a file?

- `Move-Item`
- `Rename-Item`
- `Change-Name`
- `Set-Filename`

**Hint:** Verb is "Rename", Noun is "Item".

### 29. What does "Invoke-Expression" do?

- It validates that a mathematical equation is true
- It evaluates and runs a string as a PowerShell command
- It removes a variable from the current shell memory
- It converts a numeric value into a string data type

**Hint:** It runs a string as if it were code.

### 30. Which cmdlet is used to find the version of PowerShell?

- `Get-PowerShellVersion`
- `$PSVersionTable`
- `Check-Host`
- `Show-Version`

**Hint:** Actually, it is a variable table.
