In one sentence, what is PowerShell as a platform, and how does its output differ from classic Unix-style shells?
It is a shell and scripting language built on .NET; commands emit structured objects (properties and methods), not only text. Formatting often happens at the end of a pipeline when you send output to the host or a file.
Contrast Windows PowerShell 5.1 with PowerShell 7+ (pwsh) — when would you still care about 5.1 in production?
5.1 ships with Windows and remains common for legacy modules and tooling. PowerShell 7+ is cross-platform and the modern default for new scripts when allowed — but some Windows-only modules still target 5.1, so you must know which runtime your runbooks and agents use.
Name three discovery cmdlets you’d use before writing automation, and what each is for.
Get-Help (parameters, examples, inputs/outputs — often -Full or -Examples); Get-Command (find cmdlets/functions by name or pattern); Get-Member (list properties and methods on pipeline objects). Treat Get-Help as the first habit for unfamiliar commands.
What travels through the pipeline (|), and why does that matter for scripting?
.NET objects pass between commands — | is not the same as “text pipes” in Unix shells. You select, sort, and filter with object properties (e.g. Where-Object, Select-Object) instead of parsing strings unless you choose to.
List useful common parameters that appear on many cmdlets and what WhatIf / Confirm are for.
Examples: -ErrorAction, -Verbose, -WhatIf, -Confirm. -WhatIf shows what a destructive cmdlet would do; -Confirm prompts before change. Learn these once and reuse everywhere for safer ops and learning.
Single quotes vs double quotes in PowerShell strings — what expands inside each?
Single quotes are literal (no variable expansion). Double quotes expand $variables and $(expressions). Pick quoting to control whether substitution happens.
What is splatted parameter passing, and why do people use a hashtable for it?
You build a hashtable (@{}) of parameter names and values, then call the cmdlet with @params so the table splats into named parameters. It keeps scripts readable and avoids long one-liners with many switches.
What is dot sourcing (. .\script.ps1) vs running .\script.ps1, and when do you need dot sourcing?
Dot sourcing runs the script in the current scope so defined functions and variables remain available afterward. Plain .\script.ps1 runs in a child scope; definitions do not persist in your session unless you dot-source.
What does execution policy control, and what is it not?
It controls whether scripts from disk run (Get-ExecutionPolicy / Set-ExecutionPolicy). It is not a strong security boundary against a determined user — it reduces accidental script execution. CI and agents should set it explicitly.
How do $ErrorActionPreference, non-terminating errors, and try / catch relate — what do you often add to a cmdlet so catch actually runs?
$ErrorActionPreference sets default handling for non-terminating errors (e.g. Continue, Stop). try / catch handles terminating errors; for cmdlets that would only non-terminate, use -ErrorAction Stop (or set preference to Stop) so failure becomes terminating and catch fires.
What does $? indicate, and why is it insufficient alone in automation?
$? is success/failure of the last command — handy interactively. For automation you still want explicit error handling, logging, and exit codes rather than relying only on $?.
At a high level, what is PowerShell remoting over WinRM, and what is it often used for in Windows estates?
Commands run on remote Windows hosts via Enter-PSSession / Invoke-Command — common for patching, health checks, and fleet work when SSH is not the standard. Production often layers sessions, JEA, or CI agents instead of ad hoc patterns.
Name three automation hygiene points that align with SRE practice for PowerShell on servers.
Prefer gMSA or dedicated service accounts with least privilege over interactive admins in scheduled jobs and CI. Keep secrets in vaults / SecretManagement / platform stores — not in git; inject securely. Use -WhatIf / -Confirm when learning or validating change windows.
How does PowerShell fit next to languages like Python in a hybrid platform role?
Use PowerShell where .NET, Windows, and Microsoft modules are the shortest path; use Python/Go/Java for broader cross-platform glue when that fits. PowerShell still calls .exe tools (sqlcmd, installers, cloud CLIs) and can emit JSON/CSV for observability — same reliability themes: logging, testing in non-prod, version control, review.