No matching pages. Try a shorter term or reset the filters.
Browse sections11 pages
- Real Labs
Build practical PowerShell admin projects for reporting, onboarding, inventory, troubleshooting and automation, with safety checks and verification steps.
- Learn PowerShell: Beginner to Advanced
Start with objects and pipelines, then build scripts for Active Directory, reporting and remote administration. Follow a learning track or choose a task.
- PowerShell command reference
Browse 182 PowerShell commands with syntax, parameters, object output, examples, and module notes for Windows, Microsoft 365, Azure, AD, files, and automation.
- PowerShell errors: find the cause and the fix
Match your error message to one of 15 guides. Each explains what failed, likely causes, diagnostic checks and the next steps to resolve it.
- Task guides
Browse PowerShell learning paths by task: Active Directory, remoting, cloud administration, files, debugging and Windows operations.
- PowerShell interview questions & quiz
Prepare for PowerShell interviews with explained scenario questions, then test your understanding with a 12-question PowerShell quiz.
- PowerShell modules: installation and command reference
Find module prerequisites, installation guidance and the commands used for Windows, Active Directory and cloud administration.
- PowerShell quiz: test your understanding
Answer topic-based questions about commands, scripting and administration. Read the explanation, revisit the lesson and try the next question.
- PowerShell scripts: examples to review and adapt
Explore explained scripts for Windows, Active Directory, Microsoft Entra and reporting. Review the prerequisites and sample output before adapting a script.
- PowerShell troubleshooting: diagnose the symptom
Investigate script, module, remoting and permission problems with a focused check, an explanation of the cause and a practical next step.
- PowerShell practice: short, checked exercises
Practice PowerShell with 40 browser exercises, daily and 30-day challenges, real admin projects, error diagnosis, pipeline labs, and progress tracking.
Lessons & guides89 pages
- AD Sync PowerShell commands for Microsoft Entra Connect
Inspect the Entra Connect scheduler, choose Delta or Initial sync and verify connector results before declaring directory synchronization complete.
- Build an Active Directory account review
Query users, groups and domain controllers; validate directory state before making changes.
- Azure PowerShell
Learn Azure PowerShell administration with the Az module. Explore command examples, inspect the results and practice working with Azure resources and context.
- Check your PowerShell version and edition
Check $PSVersionTable, distinguish Windows PowerShell from PowerShell 7 and identify the executable used by a script or scheduled task.
- Exchange Online PowerShell
Learn Exchange Online PowerShell for mailbox and mail-flow administration. Follow command examples, interpret the output and practice working with cloud mail.
- Execution Policy
Identify which policy applies before changing a setting or unblocking a script. Read the command examples and check the expected output.
- Review large log files before touching them
Copy, query, compare and export files while checking paths, encoding, byte counts and integrity.
- Filtering with Where-Object
Learn how Where-Object tests each pipeline object one at a time with comparison operators like -eq, -gt, and -like.
- Get-Command tutorial: discover PowerShell commands
Learn to discover PowerShell commands with Get-Command. Filter by verb, noun or module, inspect available commands and practice with explained examples.
- Get-Help tutorial: read syntax and examples
Learn to use Get-Help in PowerShell to find syntax, parameters and examples. Explore the help system and practice checking command usage before running scripts.
- Get-Member tutorial: inspect PowerShell objects
Learn to inspect PowerShell objects with Get-Member. Discover their types, properties and methods, interpret the output and apply the lesson in an exercise.
- Installing PowerShell
Learn to install and verify PowerShell, identify the executable in use and check your version. Follow practical examples before starting your scripting work.
- Check tenant, permission and completeness in Graph
Connect to the right tenant, request the required permissions and inspect cloud inventory as objects.
- Microsoft Graph PowerShell
Learn Microsoft Graph PowerShell for cloud identity administration. Explore command examples, understand returned objects and practice Microsoft cloud queries.
- Modules
Learn how PowerShell modules package reusable automation. Explore module examples, understand their structure and practice organizing commands for reuse.
- Objects versus text
Understand how PowerShell object pipelines differ from text processing, inspect properties and keep structured data available for the next command.
- PowerShell 5.1 and PowerShell 7
Windows PowerShell 5.1 vs PowerShell 7: key differences, .NET Framework vs .NET, and what works where. Know which version to target for your scripts.
- PowerShell AD computers
Learn to inventory Active Directory computer accounts with PowerShell. Follow query examples, inspect returned properties and practice interpreting the results.
- PowerShell AD groups
Learn Active Directory group management with PowerShell. Explore group membership and structure through command examples, explained output and a practice task.
- PowerShell AD replication
Learn to diagnose Active Directory replication with PowerShell. Follow examples, inspect returned results and practice investigating replication failures.
- PowerShell AD users
Learn to query and manage Active Directory users with PowerShell. Follow command examples, inspect user properties and practice working with directory objects.
- PowerShell Active Directory module
Manage AD users, groups, computers and OUs with the ActiveDirectory module. Installation, key cmdlets like Get-ADUser, and hands-on examples.
- PowerShell Advanced functions
Turn plain functions into advanced functions with [CmdletBinding()]. Get -Verbose, -Debug and common parameters for free, plus pipeline support and validation.
- PowerShell Arrays
Learn PowerShell arrays for working with collections. Follow examples for reading values, understand the output and practice processing multiple items.
- PowerShell Background jobs
Run long tasks without blocking your prompt using PowerShell background jobs. Start-Job, Get-Job, Receive-Job and Wait-Job explained with practical examples.
- PowerShell CIM versus WMI
Learn the differences between CIM and WMI in PowerShell. Explore the Windows management interface through command examples, explained results and an exercise.
- PowerShell CSV
Learn to import and export CSV data in PowerShell. Follow examples, understand how rows become objects and practice moving tabular data through your scripts.
- PowerShell Code signing
Learn PowerShell code signing and trust verification. Follow examples for signed scripts, inspect the results and practice checking trust before execution.
- PowerShell Comparison operators
PowerShell Comparison operators: read the examples, check prerequisites and follow the explanation before using the command in your environment.
- PowerShell DNS troubleshooting
Compare the same DNS question across the resolution paths your application actually uses. Read the command examples and check the expected output.
- PowerShell Desired State Configuration
Describe what a machine should look like and let DSC make it so. Write Configuration blocks with resources that declare desired state, not steps.
- PowerShell Entra users and groups
Manage Entra ID users and groups through Microsoft Graph with PowerShell. Learn the cmdlets, avoid common pitfalls, and script identity tasks safely.
- PowerShell ErrorRecord
Learn to inspect PowerShell ErrorRecord objects beyond the error headline. Follow diagnostic examples and practice reading exception details to trace failures.
- PowerShell Event logs
Learn to query Windows event logs with PowerShell. Explore diagnostic and security log examples, interpret the results and practice narrowing a query.
- PowerShell FSMO roles
Learn Active Directory FSMO roles and inspect operations master role holders with PowerShell. Follow examples and practice interpreting domain information.
- PowerShell Firewall administration
Control Windows Firewall with the NetSecurity module. Get-NetFirewallRule, New-NetFirewallRule and Set-NetFirewallRule with real-world rule examples.
- PowerShell ForEach-Object -Parallel
Speed up loops with ForEach-Object -Parallel in PowerShell 7. Run iterations concurrently in separate runspaces and learn throttle limits and gotchas.
- PowerShell Functions
Learn to turn repeated PowerShell commands into reusable functions. Follow worked examples, understand function behavior and practice organizing script logic.
- PowerShell GPO troubleshooting
Trace the effective policy for an affected user and computer instead of guessing from a GPO link. Read the command examples and check the expected output.
- PowerShell Hashtables
Learn PowerShell hashtables for key-value data. Follow examples for storing and reading entries, inspect the output and practice using structured lookups.
- PowerShell JEA
Learn Just Enough Administration in PowerShell to constrain operator capabilities. Explore examples, understand access models and practice applying the lesson.
- PowerShell JSON
Learn to work with JSON in PowerShell for APIs and configuration. Follow conversion examples, inspect returned objects and practice handling structured data.
- PowerShell Kerberos and SPNs
Understand Service Principal Names and how Kerberos authentication works. Diagnose SPN issues that cause silent NTLM fallback or outright auth failures.
- PowerShell Least privilege automation
Stop over-privileging automation accounts. Learn to scope service accounts and scheduled tasks to minimum rights without breaking scripts.
- PowerShell Module architecture
Structure PowerShell modules others can actually use. Learn the conventional layout: public vs private functions, manifests, one function per file.
- PowerShell Operational runbooks
Write runbooks someone can follow at 3 AM. Learn to document procedures clearly, then automate from the runbook with PowerShell.
- PowerShell PSCustomObject
Learn to build PowerShell reporting objects with PSCustomObject. Follow examples for named properties, inspect the output and practice creating structured data.
- PowerShell PSScriptAnalyzer
Catch bugs before runtime with PSScriptAnalyzer. Run Invoke-ScriptAnalyzer to check code against best-practice rules without executing anything.
- PowerShell Parameters and validation
Reject invalid inputs at the boundary and explain what your function accepts. Read the command examples and check the expected output.
- PowerShell Performance measurement
Find slow code with Measure-Command. Learn to benchmark script blocks, compare approaches, and spot performance bottlenecks in your automation.
- PowerShell Pester
Learn to write automated PowerShell tests with Pester. Follow worked examples, understand assertions and test results, then practice verifying script behavior.
- PowerShell Pipeline binding
Make your functions accept pipeline input. Learn [Parameter(ValueFromPipeline)], process blocks, and how objects flow between commands.
- PowerShell Processes
Learn to inspect CPU and memory usage with PowerShell process commands. Follow examples, interpret process properties and practice investigating programs.
- PowerShell REST APIs
Learn to call REST APIs with PowerShell and handle structured responses. Follow request examples, inspect returned objects and practice using service data.
- PowerShell Regex and wildcards
Stop mixing up PowerShell's two pattern systems. Learn when to use wildcards vs regex, with -like, -match and -replace explained through examples.
- PowerShell Remoting
Learn PowerShell remoting for remote Windows administration. Follow command examples, understand session behavior and practice working with remote results.
- PowerShell Runspaces
Learn how PowerShell runspaces support concurrent work. Explore execution examples, understand the output and practice the concepts behind parallel automation.
- PowerShell SSH remoting
Learn cross-platform PowerShell remoting over SSH. Review the session examples, understand remote command execution and practice interpreting returned output.
- PowerShell Scheduled Tasks
Automate with the ScheduledTasks module. Build tasks from actions, triggers and principals, then register them with Register-ScheduledTask.
- PowerShell Scope
Learn PowerShell scope and variable visibility. Follow examples showing variable visibility, inspect the results and practice reasoning about script state.
- PowerShell Script governance
Keep your script library from becoming a liability. Learn versioning, review practices, and standards that make automation safe to change.
- PowerShell Services
Learn to inspect and control Windows services with PowerShell. Follow examples, understand service state and practice checking results before taking action.
- PowerShell Sites and Services
Check client subnet mapping and replication topology as separate parts of a site problem. Read the command examples and check the expected output.
- PowerShell Splatting
Learn how to pass named parameters with a PowerShell hashtable, keep command calls readable and reuse options with splatting.
- PowerShell Thread jobs
Learn lightweight PowerShell concurrency with thread jobs. Follow examples for starting work and collecting results, then practice inspecting job behavior.
- PowerShell Transcript logging
Record every command and output with Start-Transcript and Stop-Transcript. Create audit trails for change windows and incident response.
- PowerShell Verbose and diagnostic streams
Master PowerShell's six output streams. Learn when to use Write-Verbose, Write-Debug and Write-Warning, and how to redirect each stream.
- PowerShell WinRM
Learn WinRM prerequisites for Windows PowerShell remoting. Follow the examples, understand connection requirements and practice checking your remoting setup.
- PowerShell Windows networking
Replace ipconfig with objects. Use Get-NetAdapter, Get-NetIPAddress and Get-NetRoute from the NetTCPIP module for scriptable network admin.
- Find the failing operation before changing the script
Read error records, test assumptions and preserve useful evidence when automation fails.
- PowerShell for / while / do
Master PowerShell's three remaining loops: for, while, and do. Learn when each runs, how conditions are tested, and avoid infinite loops with clear examples.
- PowerShell foreach
Learn to iterate collections with foreach in PowerShell. Follow worked examples, understand how each item is processed and practice writing your own loop.
- PowerShell if / elseif / else
Control script flow with if, elseif and else. Learn condition syntax, comparison operators, and how PowerShell evaluates truthiness in branching logic.
- PowerShell in CI/CD
Learn to treat PowerShell scripts as software in CI/CD workflows. Follow examples, understand automated checks and practice preparing scripts for a pipeline.
- Build a report from PowerShell objects
Learn filters, projections, sorting, functions and data types, then check your understanding in the practice console.
- Locate the layer that breaks a remote session
Diagnose WinRM, sessions, remote queries and authentication with checks that isolate the failing layer.
- PowerShell switch
Learn the PowerShell switch statement for handling multiple cases. Follow worked examples, understand matching behavior and practice choosing the right branch.
- PowerShell try, catch and finally
Learn which errors catch handles, when to use ErrorAction Stop and how finally supports cleanup after a command succeeds or fails.
- $ErrorActionPreference: the dial behind every error
Learn how $ErrorActionPreference decides what happens after a cmdlet error. Compare Continue, SilentlyContinue, Stop, and Inquire.
- Providers and PSDrives
Navigate the registry, certificates and variables like filesystems. Learn PowerShell providers and PSDrives: Get-ChildItem and Set-Location work everywhere.
- Run PowerShell commands and scripts from CMD
Launch powershell.exe or pwsh from CMD, choose -File or -Command, quote paths correctly and inspect the process exit code.
- SharePoint Online PowerShell
Learn SharePoint Online administration with PowerShell. Explore site and permission management examples, inspect results and practice administrative queries.
- Teams PowerShell
Learn Microsoft Teams administration with PowerShell. Follow command examples, inspect returned data and practice using Teams queries in administrative work.
- The pipeline
Learn how the PowerShell pipeline passes objects between commands. Follow examples, inspect properties and practice combining commands into useful queries.
- Update PowerShell on Windows without confusing editions
Update PowerShell 7, distinguish engine updates from module updates and verify which executable your automation uses after the change.
- Variables
Learn how PowerShell variables store values and how scope affects access. Follow assignment examples, inspect output and practice using variables in scripts.
- What is PowerShell?
Learn what PowerShell is, how its object pipeline works and how it differs from a traditional command prompt. Explore examples and try the lesson exercise.
- Windows Update PowerShell commands: inventory and checks
Inspect installed hotfixes, understand Get-HotFix coverage and distinguish Windows Update automation from PowerShell and module updates.
- Read process memory without guessing at CPU load
Inspect service state, process memory, CPU totals, event logs and scheduled tasks without confusing state with health.
- Your first Verb-Noun command
Every PowerShell command is Verb-Noun. Learn the naming pattern so you can guess Get-Process, Stop-Service and New-Item correctly on the first try.
Practice exercises40 pages
- Audit disabled AD accounts
Return the disabled accounts and their sign-in names.
- Check stopped manual services
Return services that are both stopped and configured for Manual startup.
- Combine service filters in PowerShell
Practice PowerShell: return services that are both Running and Manual, sorted by Name. Both conditions must hold. Build the pipeline and check the result.
- Compare process working sets
Return the two processes with the largest working sets.
- Exclude the browser process in PowerShell
Practice PowerShell: return all processes except the one named chrome, sorted by Name. Build the pipeline and check the result.
- Filter accumulated CPU time in PowerShell
Practice PowerShell: return processes whose cumulative CPU time is greater than five seconds. Build the pipeline and check the result.
- Filter by memory use in PowerShell
Practice PowerShell: return processes with more than 100 MiB of working-set memory. The WS property is measured in bytes.
- Find accounts outside the IT department
Return every account that is not in the IT department.
- Find automatic services in PowerShell
Practice PowerShell: return services with an Automatic start type, sorted by Name. Build the pipeline and check the result.
- Find deallocated Azure VMs
Return the VMs that are deallocated.
- Find enabled IT staff accounts
Return the enabled accounts in the IT department, with their sign-in names.
- Find large log files
Return .log files larger than 10 MiB, largest first.
- Find manual services in PowerShell
Practice PowerShell: return all services configured for Manual startup, including stopped services. Build the pipeline and check the result.
- Find process IDs above 9000 in PowerShell
Practice PowerShell: return processes whose Id is greater than 9000, sorted by Id. Build the pipeline and check the result.
- Find processes below two CPU seconds in PowerShell
Practice PowerShell: return processes with cumulative CPU time below two seconds. Build the pipeline and check the result.
- Find running W services in reverse order in PowerShell
Practice PowerShell: return running services whose Name matches W*, sorted by Name in descending order.
- Find services outside automatic startup in PowerShell
Practice PowerShell: return every service whose StartType is not Automatic. Build the pipeline and check the result.
- Find stopped Azure VMs: practice drill
Return the VMs that are stopped, with their resource groups.
- Find stopped services in PowerShell
Practice PowerShell: return every stopped service from the sample machine. Build the pipeline and check the result.
- Find the DNS service by name in PowerShell
Practice PowerShell pipeline reasoning using fictional services data. Build the pipeline in your browser and check the expected result for this task.
- Find the busiest processes
Practice PowerShell: return the two processes with the highest cumulative CPU time, highest first. CPU is measured in seconds, not percent.
- Find the largest process below 100 MiB in PowerShell
Practice PowerShell: exclude processes using 100 MiB or more of working-set memory, then return the single largest remaining process.
- Find the largest working set in PowerShell
Practice PowerShell: return the one process with the largest WS value. Build the pipeline and check the result.
- Find the smallest working sets in PowerShell
Practice PowerShell: return the three processes with the smallest working-set memory, smallest first. Sort all processes before limiting the result.
- Identify script-based modules
Return available modules whose ModuleType is Script.
- Inspect PowerShell processes in PowerShell
Practice PowerShell: return processes whose Name matches pw*, sorted by CPU descending. Build the pipeline and check the result.
- Inspect error events
Return event IDs and providers for Error events.
- List Finance team accounts
Return every account in the Finance department.
- List Lab resource group VMs
Return every VM in the Lab resource group.
- List running services in PowerShell
Practice PowerShell filtering: Return every running service. Run the pipeline against fictional services data in your browser and check the expected result.
- List service names beginning with W in PowerShell
Practice PowerShell: return the Name values of every service whose name begins with W, sorted alphabetically. Include stopped services.
- Reverse the service list in PowerShell
Practice PowerShell: return all services in descending Name order. Build the pipeline with fictional sample data, run it in the browser, and check your result.
- Review non-running Azure VMs
Return the names and power states of non-running VMs.
- Select the two busiest small processes in PowerShell
Practice PowerShell: among processes using less than 100 MiB of working-set memory, return the two with the highest cumulative CPU seconds, highest first.
- Sort AD accounts by name
Return all accounts in alphabetical order, showing whether each is enabled.
- Sort Azure VMs by name
Return all VMs in alphabetical order with their power states.
- Sort processes alphabetically in PowerShell
Practice PowerShell: return every process in ascending Name order. Build the pipeline with fictional sample data, run it in the browser, and check your result.
- Sort the service list in PowerShell
Practice PowerShell: return every service, sorted alphabetically by Name. Build the pipeline and check the result.
- Take the first three service names in PowerShell
Practice PowerShell: sort service names alphabetically, then return the first three. Build the pipeline and check the result.
- Verify a service-name exclusion
Return all other service names in alphabetical order.
Projects & site information5 pages
- Service health review: a guided PowerShell project
Build a PowerShell service health review: inspect fictional service objects, filter stopped services, compare startup policy, and hand off a status report.
- Active Directory account review: a guided PowerShell project
Build a PowerShell AD account review: inspect fictional users, find disabled accounts, scope by department, and prepare a readable exception report.
- Windows event log triage: a guided PowerShell project
Build a PowerShell event log triage project: filter fictional System errors, inspect providers, and prepare an incident handoff with verification steps.
- Log file inventory: a guided PowerShell project
Build a PowerShell log file inventory: filter fictional files by extension and size, rank the largest logs, and prepare a safe cleanup review.
- Privacy
How PowerShell Genie stores local learning progress and optional Google account sync data.
Guided project1 pages
- Process health snapshot: a guided PowerShell project
Guided PowerShell project: build a process health snapshot across five milestones -- discover objects, filter with Where-Object, sort, shape a report, and defend it.
Tools & activities30 pages
- Build Entra ID automation around Microsoft Graph objects
Practise Entra ID PowerShell workflows for users, groups, permissions, identity inventory and safe changes using Microsoft Graph.
- 30-day PowerShell challenge
Build PowerShell fluency with 30 daily command challenges, browser-based checking, solutions and local progress that stays on your device.
- Build a PowerShell command, then verify it with help
Build a PowerShell Verb-Noun command shape with parameters and values, then verify the real syntax and parameter sets with Get-Help.
- Build a PowerShell pipeline and inspect every stage
Build a service or process query and inspect the objects after every stage. Compare the generated PowerShell with a transparent, repeatable sample result.
- PowerShell Cheat Sheet
Quick-reference PowerShell cheat sheet: essential commands, pipeline patterns, and syntax on one page.
- Choose a PowerShell path for the work you do
Choose a PowerShell learning path for Windows, Active Directory, Microsoft 365, Azure and Entra, automation, or help desk work. Track practical progress.
- Explain a PowerShell script line by line
Paste a PowerShell script and inspect its commands, variables, pipelines and control flow with a browser-based learning explainer.
- How PowerShell Genie teaches and checks examples
Learn how PowerShell Genie checks examples, labels fictional output, uses primary documentation and prepares reproducible correction reports.
- Learn DSC 3 without confusing it with old PowerShell DSC
Learn DSC concepts through practical PowerShell examples covering resources, desired state, idempotency, testing and configuration workflows.
- PowerShell Performance Lab
Compare PowerShell approaches with measurement-first exercises for filtering, loops, pipelines and parallel work before optimising scripts.
- Migrate Windows PowerShell 5.1 to PowerShell 7 with evidence
Plan a safer move from Windows PowerShell 5.1 to PowerShell 7 by checking modules, editions, remoting, compatibility and script behavior.
- PowerShell 5.1 and 7 compatibility checklist
Compare Windows PowerShell 5.1 and PowerShell 7 behavior, editions, modules and platform support before running or migrating scripts.
- PowerShell Cheat Sheet
Download a PowerShell cheat sheet PDF with common commands, pipeline patterns, object filtering, sorting, services, processes, CSV export, and visual examples.
- PowerShell Genie updates
Read new PowerShell practice challenges and reference updates, then open the featured exercises and command guides.
- PowerShell error decoder
Paste common PowerShell error text to identify the likely category, understand what it means and start with safer diagnostic checks.
- Exercise Lab: assemble a working PowerShell pipeline
Assemble PowerShell command blocks into a working pipeline — predict the output, check stage order, and diagnose errors.
- PowerShell script library: choose a reporting workflow
Browse practical PowerShell scripts with prerequisites, expected behavior, safety notes and verification steps for common admin work.
- PowerShell labs: build and inspect pipelines
Explore PowerShell labs for commands, pipelines, debugging, performance, migration, cloud administration and interview practice.
- PowerShell interview simulator
Practise realistic PowerShell interview scenarios, write your answer first, then compare it with an operational reasoning rubric.
- Review one PowerShell script like an engineer
Study one practical PowerShell script at a time with context, safety notes, explanation and ideas for adapting it to real admin work.
- PowerShell visual demos
Step through short PowerShell visual demos for pipelines, objects, Get-Member and error handling, then continue into hands-on practice.
- See what a PowerShell object actually contains
Explore PowerShell objects for services, processes, files and Active Directory. Inspect properties and methods, then build Select-Object pipelines.
- Your PowerShell journey
Track completed PowerShell challenges, labs and practice activities locally in your browser without creating an account.
- Site index
Browse PowerShell Genie lessons, command examples, troubleshooting guides, practice tasks, and reference pages from one organized site index.
- Daily PowerShell challenge: one task at a time
Practice one short PowerShell admin challenge every day. Write a command, check the pipeline, reveal a hint, and build a local practice streak.
- PowerShell challenge lab: build a complete report
Work through a 60–90 minute challenge lab combining command choice, object filtering, verification and practical reasoning.
- Track PowerShell changes that affect real scripts
Review notable PowerShell platform changes and connect release differences to migration, compatibility and administrator learning resources.
- PowerShell Script Clinic
Improve PowerShell scripts by spotting brittle patterns, refactoring for clarity, adding error handling and verifying behavior after each change.
- Use PowerShell for Microsoft 365 administration without losing tenant context
Practise Microsoft 365 PowerShell workflows for Graph, Exchange Online, permissions, reporting, tenant context and safe automation.
- Use PowerShell to inspect Azure before you automate changes
Practise Azure PowerShell with subscription context, resource discovery, reporting, safe changes and automation patterns for administrators.
Commands182 pages
- Add-ADGroupMember
Use Add-ADGroupMember to add users, computers or other groups to an Active Directory group.
- Add-Content
Use Add-Content to append a value to the end of a file, leaving existing content in place.
- Clear-Content
Use Clear-Content to empty a file without deleting it, leaving a zero-length file behind.
- Compare-Object
Use Compare-Object to compare two sets of objects and report which items are only in one of them.
- Compress-Archive
Use Compress-Archive to create a zip archive from files or folders.
- Connect-AzAccount
Use Connect-AzAccount to sign in to Azure and verify the tenant and subscription context. See Az module requirements and examples.
- Connect-ExchangeOnline
Use Connect-ExchangeOnline to connect to Exchange Online and verify the administrator session. See ExchangeOnlineManagement module requirements and examples.
- Connect-MgGraph
Use Connect-MgGraph to connect to Microsoft Graph with delegated or app-only authentication. See Microsoft.Graph module requirements and examples.
- ConvertFrom-Json
Use ConvertFrom-Json to convert a JSON-formatted string to a PowerShell object. See Microsoft.PowerShell.Utility module requirements and examples.
- ConvertTo-Json
Use ConvertTo-Json to convert an object to a JSON-formatted string. See Microsoft.PowerShell.Utility module requirements and examples.
- ConvertTo-Xml
Use ConvertTo-Xml to convert objects into an XML representation of their properties.
- Copy-Item
Use Copy-Item to copy files or directories. Review path handling, recursive copies and examples before choosing a destination.
- Disable-ADAccount
Use Disable-ADAccount to disable an Active Directory user or computer account, blocking sign-in while keeping the object.
- Enable-ADAccount
Use Enable-ADAccount to enable a disabled Active Directory user or computer account.
- Enter-PSSession
Use Enter-PSSession to start an interactive remoting session, redirecting your prompt to a remote computer.
- Expand-Archive
Use Expand-Archive to extract the contents of a zip archive to a folder.
- Export-Csv
Use Export-Csv to convert objects into CSV-formatted data and write it to a file. See Microsoft.PowerShell.Utility module requirements and examples.
- Find-Module
Use Find-Module to search a registered repository for modules without installing anything.
- ForEach-Object
Use ForEach-Object to perform an operation on each item in a collection of input objects. See Microsoft.PowerShell.Utility module requirements and examples.
- Format-List
Use Format-List to render each object as a vertical list of property names and values.
- Format-Table
Use Format-Table to render objects as a table of columns for display.
- Get-ADComputer
Use Get-ADComputer to retrieve computer accounts from Active Directory.
- Get-ADDomain
Use Get-ADDomain to return information about an Active Directory domain, including its FSMO role holders and naming contexts.
- Get-ADDomainController
Use Get-ADDomainController to retrieve domain controllers in a domain or forest, with their roles, site and status.
- Get-ADForest
Use Get-ADForest to return information about an Active Directory forest, including its domains, sites and forest-level role holders.
- Get-ADGroup
Use Get-ADGroup to retrieve security and distribution groups from Active Directory.
- Get-ADGroupMember
Use Get-ADGroupMember to list the members of an Active Directory group, optionally expanding nested groups.
- Get-ADObject
Use Get-ADObject to retrieve any object from Active Directory regardless of type, including deleted objects.
- Get-ADOrganizationalUnit
Use Get-ADOrganizationalUnit to list Active Directory OUs with their distinguished names — the containers Group Policy and delegated administration target.
- Get-ADReplicationFailure
Use Get-ADReplicationFailure to report AD replication failures per domain controller, so an unreplicated change stops looking like a permissions problem.
- Get-ADReplicationPartnerMetadata
Use Get-ADReplicationPartnerMetadata to show when each replication partner last succeeded — the complement to Get-ADReplicationFailure.
- Get-ADUser
Use Get-ADUser to retrieve user accounts from Active Directory by identity, filter or LDAP query.
- Get-Acl
Use Get-Acl to return the security descriptor of a file, folder, registry key or other securable object.
- Get-Alias
Use Get-Alias to list the aliases defined in the session, or resolve an alias to the command it points at.
- Get-AuthenticodeSignature
Use Get-AuthenticodeSignature to read a file's signature status: Valid, NotSigned, HashMismatch, NotTrusted, NotSupportedFileFormat, or UnknownError.
- Get-AzContext
Use Get-AzContext to inspect the active Azure account, tenant and subscription. See Az module requirements and examples.
- Get-AzDisk
Use Get-AzDisk to inventory Azure managed disks and inspect attachment state. See Az module requirements and examples.
- Get-AzKeyVault
Use Get-AzKeyVault to list Azure vault resources and distinguish access to secret values. See Az module requirements and examples.
- Get-AzResource
Use Get-AzResource to inventory Azure resources by resource group and resource type. See Az module requirements and examples.
- Get-AzResourceGroup
Use Get-AzResourceGroup to query Azure resource groups and inspect location and tags. See Az module requirements and examples.
- Get-AzRoleAssignment
Use Get-AzRoleAssignment to query Azure role assignments by identity, scope and role. See Az module requirements and examples.
- Get-AzStorageAccount
Use Get-AzStorageAccount to inventory Azure storage accounts and inspect configuration. See Az module requirements and examples.
- Get-AzSubscription
Use Get-AzSubscription to list accessible Azure subscriptions and inspect their tenant IDs. See Az module requirements and examples.
- Get-AzVM
Use Get-AzVM to retrieve Azure VM configuration and check power state with Status. See Az module requirements and examples.
- Get-ChildItem
Use Get-ChildItem to get the items and child items in one or more specified locations.
- Get-CimInstance
Use Get-CimInstance to get instances of CIM classes from a CIM server. See CimCmdlets module requirements and examples.
- Get-CimSession
Use Get-CimSession to list the CIM sessions open in the current PowerShell session.
- Get-Command
Use Get-Command to get information about PowerShell commands, including cmdlets, aliases, functions, filters, scripts, applications, and external commands.
- Get-ComputerInfo
Use Get-ComputerInfo to return a single object with over a hundred properties describing the operating system and hardware.
- Get-Content
Use Get-Content to get the content of an item at the specified location, most commonly a text file.
- Get-Counter
Use Get-Counter to read Windows performance counter values, once or as a continuous sample.
- Get-Date
Use Get-Date to return the current date and time, or convert and format a date you supply.
- Get-DistributionGroup
Use Get-DistributionGroup to list distribution groups and mail-enabled security groups. See ExchangeOnlineManagement module requirements and examples.
- Get-DistributionGroupMember
Use Get-DistributionGroupMember to list a distribution group's direct members; nested groups are separate objects.
- Get-DnsClientServerAddress
Use Get-DnsClientServerAddress to show the DNS servers configured per network interface.
- Get-EXOMailbox
Use Get-EXOMailbox to inventory Exchange Online mailboxes with explicit properties. See ExchangeOnlineManagement module requirements and examples.
- Get-EXOMailboxPermission
Use Get-EXOMailboxPermission to inspect mailbox permissions — User, AccessRights, IsInherited and Deny together.
- Get-EXOMailboxStatistics
Use Get-EXOMailboxStatistics to return mailbox storage statistics such as TotalItemSize.
- Get-Error
Use Get-Error to display the most recent errors in full detail, including nested exceptions and invocation information.
- Get-ExecutionPolicy
Use Get-ExecutionPolicy to report the effective execution policy, or the policy set at each scope with -List.
- Get-FileHash
Use Get-FileHash to compute a cryptographic hash of a file, defaulting to SHA256.
- Get-GPO
Use Get-GPO to retrieve Group Policy objects by name, GUID or full inventory. See GroupPolicy module requirements and examples.
- Get-GPOReport
Use Get-GPOReport to export Group Policy reports as HTML or XML for inspection. See GroupPolicy module requirements and examples.
- Get-Help
Look up syntax, parameters and examples for a PowerShell command. Use the help output to understand a command before running it.
- Get-History
Use Get-History to return the commands run in the current session, with an id for each.
- Get-HotFix
Use Get-HotFix to list installed updates that were delivered as hotfix packages.
- Get-InboundConnector
Use Get-InboundConnector to inspect inbound mail connectors and their sender restrictions. See ExchangeOnlineManagement module requirements and examples.
- Get-InboxRule
Use Get-InboxRule to inspect mailbox inbox rules, including hidden rules and forwarding. See ExchangeOnlineManagement module requirements and examples.
- Get-InstalledModule
Use Get-InstalledModule to list modules installed by Install-Module, with the version and repository they came from.
- Get-Item
Use Get-Item to return the item at a path — file, folder, registry key, or any provider item — to inspect its properties.
- Get-Job
Use Get-Job to list the jobs in the session with their current state.
- Get-LocalGroup
Use Get-LocalGroup to list local security groups on a Windows machine.
- Get-LocalGroupMember
Use Get-LocalGroupMember to list the members of a local group, including domain accounts that belong to it.
- Get-LocalUser
Use Get-LocalUser to list local user accounts on a Windows machine with their enabled state and password settings.
- Get-Location
Use Get-Location to return the current working directory for the session.
- Get-Member
Use Get-Member to list an object's properties and methods — the fastest way to discover what pipeline output can do.
- Get-MgApplication
Use Get-MgApplication to list app registrations and inspect credential expiry in Microsoft Graph.
- Get-MgAuditLogSignIn
Use Get-MgAuditLogSignIn to query Entra sign-in logs with date filters and pagination. See Microsoft.Graph module requirements and examples.
- Get-MgGroup
Use Get-MgGroup to list Microsoft Graph groups and distinguish their membership types. See Microsoft.Graph module requirements and examples.
- Get-MgGroupMember
Use Get-MgGroupMember to enumerate direct Microsoft Graph group members with pagination. See Microsoft.Graph module requirements and examples.
- Get-MgServicePrincipal
Use Get-MgServicePrincipal to list tenant service principals and distinguish object IDs from application IDs.
- Get-MgSubscribedSku
Use Get-MgSubscribedSku to compare purchased and consumed Microsoft 365 license units. See Microsoft.Graph module requirements and examples.
- Get-MgUser
Use Get-MgUser to query Microsoft Graph users with pagination and explicit properties. See Microsoft.Graph module requirements and examples.
- Get-MgUserAuthenticationMethod
Use Get-MgUserAuthenticationMethod to list a user's registered authentication methods.
- Get-Module
Use Get-Module to list modules loaded in the session, or with -ListAvailable those installed and ready to load.
- Get-NetAdapter
Use Get-NetAdapter to list the network adapters on a Windows machine with their status, speed and MAC address.
- Get-NetFirewallRule
Use Get-NetFirewallRule to list Windows Firewall rules with their direction, action and enabled state.
- Get-NetIPAddress
Use Get-NetIPAddress to list the IP addresses configured on the machine's interfaces.
- Get-NetIPConfiguration
Use Get-NetIPConfiguration to return a per-interface summary combining IP address, gateway and DNS servers.
- Get-NetRoute
Use Get-NetRoute to list the machine's IP routing table entries with their destinations and metrics.
- Get-NetTCPConnection
Use Get-NetTCPConnection to list TCP connections and listening ports with the owning process id.
- Get-OutboundConnector
Use Get-OutboundConnector to inspect outbound mail connectors and recipient routing settings. See ExchangeOnlineManagement module requirements and examples.
- Get-PSDrive
Use Get-PSDrive to list the drives available in the session, including those that are not filesystems.
- Get-PSSession
Use Get-PSSession to list the PSSessions in the current session, or those available on a remote computer.
- Get-Process
Use Get-Process to get the processes that are running on the local computer.
- Get-Random
Use Get-Random to return a random number, or pick random items from a collection.
- Get-SPOSite
Use Get-SPOSite to inventory SharePoint Online site collections and check query limits.
- Get-SPOUser
Use Get-SPOUser to list users in a SharePoint site collection and check access assumptions.
- Get-ScheduledTask
Use Get-ScheduledTask to list scheduled tasks with their definitions, triggers and current state.
- Get-ScheduledTaskInfo
Use Get-ScheduledTaskInfo to return run history for a scheduled task: last run time, last result and next run time.
- Get-Service
Command reference for Get-Service: list services, filter by status, and inspect service objects in the pipeline.
- Get-Team
Use Get-Team to inventory Microsoft Teams and check account visibility limits. See MicrosoftTeams module requirements and examples.
- Get-TransportRule
Use Get-TransportRule to inspect Exchange mail-flow rules, priorities, conditions and modes. See ExchangeOnlineManagement module requirements and examples.
- Get-Variable
Use Get-Variable to list the variables in the current scope, or retrieve one by name.
- Get-WinEvent
Use Get-WinEvent to get events from event logs and event tracing log files on local and remote computers.
- Group-Object
Use Group-Object to group objects that share a value for one or more properties, and count each group.
- Import-Csv
Use Import-Csv to read a CSV file and return one object per row, with the header line becoming property names.
- Import-Module
Use Import-Module to load a module into the session so its commands are available.
- Install-Module
Use Install-Module to download a module from a registered repository and install it for the current user or all users.
- Invoke-Command
Use Invoke-Command to run a command or script block on one or more remote computers and return the results.
- Invoke-RestMethod
Use Invoke-RestMethod to call a REST endpoint and convert the JSON or XML response into PowerShell objects automatically.
- Invoke-WebRequest
Use Invoke-WebRequest to fetch a URL and return the full response: status code, headers, and the raw or parsed content.
- Join-Path
Use Join-Path to combine path segments into one path using the correct separator for the platform.
- Measure-Object
Use Measure-Object to count objects, or calculate sum, average, minimum and maximum for a numeric property.
- Move-ADObject
Use Move-ADObject to move an Active Directory object to a different organizational unit or container.
- Move-Item
Use Move-Item to move a file or directory to a new location, and rename it if you change the leaf name.
- New-ADComputer
Use New-ADComputer to create a computer account in Active Directory before the machine joins the domain.
- New-ADGroup
Use New-ADGroup to create a security or distribution group in Active Directory.
- New-ADUser
Use New-ADUser to create an Active Directory user account with identity attributes like -Name, -SamAccountName, -UserPrincipalName, and -AccountPassword.
- New-CimSession
Use New-CimSession to create a reusable CIM session to a remote computer for use with the CIM cmdlets.
- New-GPO
Use New-GPO to create a Group Policy object and verify its GUID before linking it. See GroupPolicy module requirements and examples.
- New-Item
Use New-Item to create a new item, such as a file, directory, registry key, or provider-specific object.
- New-PSSession
Use New-PSSession to open a persistent connection to a remote computer and return a session object.
- Out-File
Use Out-File to write the formatted text representation of objects to a file.
- Out-Host
Use Out-Host to send output to the host for display, optionally one screen at a time.
- Out-String
Use Out-String to convert objects into the string form PowerShell would have displayed.
- Receive-Job
Use Receive-Job to collect the output of a job and, by default, remove it from the job's buffer.
- Register-ScheduledTask
Use Register-ScheduledTask to create a scheduled task from action, trigger, principal and settings objects.
- Remove-ADGroupMember
Use Remove-ADGroupMember to remove members from an Active Directory group.
- Remove-ADUser
Use Remove-ADUser to delete an Active Directory user account. Confirm the identity first — deletion is immediate and hard to undo.
- Remove-CimSession
Use Remove-CimSession to close CIM sessions and release their connections.
- Remove-Item
Use Remove-Item to delete files, folders, registry keys, or other provider items; -Recurse and -Force clear non-empty trees.
- Remove-Job
Use Remove-Job to delete a job from the session, discarding any output it still holds.
- Remove-Module
Use Remove-Module to unload an imported module from the current session — handy when testing a new version of your own module.
- Remove-PSSession
Use Remove-PSSession to close a PSSession and release the resources it holds on the remote computer.
- Remove-Variable
Use Remove-Variable to delete a variable and its value from the session; -Force also clears read-only variables.
- Resolve-DnsName
Use Resolve-DnsName to query DNS for a name or address and return the records, bypassing the local cache when asked.
- Resolve-Path
Use Resolve-Path to turn a relative path or a wildcard into one or more full paths, failing if nothing matches.
- Restart-Computer
Use Restart-Computer to restart the local computer or a remote one by name; -WhatIf shows the target without restarting, and -Wait blocks until a remote Windows endpoint responds again.
- Restart-Service
Use Restart-Service to stop and then start one or more Windows services.
- Save-Module
Use Save-Module to download a module and its dependencies to a folder without installing it.
- Search-ADAccount
Use Search-ADAccount to find accounts matching a built-in condition such as locked out, disabled, expired or inactive.
- Select-Object
Use Select-Object to keep only chosen properties, take the first N objects, or expand one property into its values.
- Set-ADComputer
Use Set-ADComputer to modify attributes on an existing Active Directory computer account.
- Set-ADUser
Use Set-ADUser to modify attributes on an existing Active Directory user account.
- Set-Acl
Use Set-Acl to apply a security descriptor to a file, folder or registry key.
- Set-AuthenticodeSignature
Use Set-AuthenticodeSignature to sign a script with a code-signing certificate, proving origin and integrity.
- Set-AzContext
Use Set-AzContext to select and verify the Azure subscription and tenant for later commands. See Az module requirements and examples.
- Set-Content
Use Set-Content to replace the entire contents of a file with the value you supply.
- Set-ExecutionPolicy
Use Set-ExecutionPolicy to change the execution policy for a scope, controlling whether script files may run.
- Set-GPLink
Use Set-GPLink to change GPO link order, enforcement and enabled state for a target OU. See GroupPolicy module requirements and examples.
- Set-Location
Use Set-Location to change the current working directory, on any drive a provider exposes.
- Set-NetFirewallRule
Use Set-NetFirewallRule to change properties of existing Windows Firewall rules.
- Set-Service
Use Set-Service to start, stop or suspend a service, and change service properties such as StartupType and DisplayName.
- Set-Variable
Use Set-Variable to create or change a variable, with control over its scope and options.
- Sort-Object
Use Sort-Object to order objects by property, ascending by default or -Descending; -Unique drops duplicates.
- Split-Path
Use Split-Path to return one part of a path: the parent directory, the file name, the extension, or the qualifier.
- Start-ADSyncSyncCycle
Use Start-ADSyncSyncCycle to request a Microsoft Entra Connect Sync cycle after checking scheduler state and the intended server.
- Start-Job
Use Start-Job to run a script block in a separate background process and return a job object immediately.
- Start-Process
Use Start-Process to launch an executable or open a file with its associated program.
- Start-ScheduledTask
Use Start-ScheduledTask to run a scheduled task immediately, without waiting for its trigger.
- Start-Service
Use Start-Service to start a stopped Windows service by name or display name.
- Start-ThreadJob
Use Start-ThreadJob to run a script block on a thread inside the current process and return a job object.
- Start-Transcript
Use Start-Transcript to begin recording the session, both commands and their output, to a text file.
- Stop-Job
Use Stop-Job to stop a running job, leaving it in the session so partial output can still be collected.
- Stop-Process
Use Stop-Process to stop running processes by name or ID; -Force ends processes that ignore a normal stop request.
- Stop-ScheduledTask
Use Stop-ScheduledTask to terminate a running instance of a scheduled task.
- Stop-Service
Use Stop-Service to stop a running Windows service; -Force also stops services that depend on it.
- Stop-Transcript
Use Stop-Transcript to end the current transcript and close the file. See Microsoft.PowerShell.Host module requirements and examples.
- Tee-Object
Use Tee-Object to pass objects along the pipeline while also saving them to a file or a variable.
- Test-NetConnection
Use Test-NetConnection to test connectivity to a host, optionally on a specific TCP port, and report the route and DNS resolution.
- Test-Path
Use Test-Path to return $true or $false for whether a path exists — the guard to run before reading, writing, or deleting.
- Trace-Command
Use Trace-Command to trace PowerShell's internal operations while running an expression, showing how it resolved what you asked for.
- Unlock-ADAccount
Use Unlock-ADAccount to clear the lockout on an Active Directory account after too many failed sign-in attempts. Review examples and related commands.
- Wait-Process
Use Wait-Process to block until one or more processes exit, or until a timeout expires.
- Where-Object
Use Where-Object to select objects from a collection based on their property values. See Microsoft.PowerShell.Utility module requirements and examples.
- Write-Debug
Use Write-Debug to write a developer-facing message to the debug stream, hidden unless -Debug is passed.
- Write-Error
Use Write-Error to write a non-terminating error to the error stream without stopping execution.
- Write-Information
Use Write-Information to write a tagged message to the information stream, which can be captured separately from output.
- Write-Output
Use Write-Output to send objects to the success stream, which is the stream the pipeline carries and a caller can capture.
- Write-Verbose
Use Write-Verbose to write a diagnostic message that stays hidden unless the caller asks for it with -Verbose.
- Write-Warning
Use Write-Warning to write a message to the warning stream, shown by default but kept out of your data.
Modules27 pages
- ActiveDirectory module: setup and commands
Query users, groups and computers with Get-ADUser and Get-ADGroup, then avoid broad searches by choosing a search base and requested properties.
- Az.Accounts module: setup and commands
Connect with Connect-AzAccount, inspect subscriptions with Get-AzSubscription and set the intended tenant and subscription context before Azure changes.
- Az.Compute module: setup and commands
Inspect Azure VMs with Get-AzVM, read power state explicitly and manage disks or scale sets without confusing configuration with live status.
- Az.KeyVault module: setup and commands
Find vaults with Get-AzKeyVault, retrieve secrets deliberately and distinguish control-plane access from permission to read secret values.
- Az.Network module: setup and commands
Inspect Azure virtual networks, subnets, NSGs and public IPs with Az.Network while keeping resource group, region and object IDs explicit.
- Az.Resources module: setup and commands
Inventory Azure resources with Get-AzResource and Get-AzResourceGroup, then scope changes carefully by subscription, resource group, type and tag.
- Az.Storage module: setup and commands
Work with Azure storage accounts and data services, keeping management-plane resources separate from blob, file, queue and table operations.
- DhcpServer module: setup and commands
Inspect DHCP scopes, leases, reservations and options with Get-DhcpServerv4Scope before changing address pools or client configuration.
- DnsServer module: setup and commands
Query DNS zones and records with Get-DnsServerZone and Get-DnsServerResourceRecord before changing forwarders, aging or scavenging.
- ExchangeOnlineManagement module: setup and commands
Connect with Connect-ExchangeOnline and query mailboxes with Get-EXOMailbox while requesting only the properties your report actually needs.
- GroupPolicy module: setup and commands
Find Group Policy objects with Get-GPO and export evidence with Get-GPOReport before changing links, inheritance or enforcement.
- Hyper-V module: setup and commands
Inspect VMs with Get-VM, review checkpoints and virtual switches, and distinguish configured state from replication and runtime health.
- Microsoft.Graph module: setup and commands
Connect to Microsoft Graph with explicit scopes, inspect the active context and query only the users, groups or devices your automation needs.
- Microsoft.Online.SharePoint.PowerShell module: setup and commands
Connect to the SharePoint Online admin service, inventory sites with Get-SPOSite and verify tenant permissions before changing site settings.
- Microsoft.PowerShell.Diagnostics module: setup and commands
Read Windows event and diagnostic data with Get-WinEvent and related cmdlets while filtering at the provider instead of after retrieval.
- Microsoft.PowerShell.Management module: setup and commands
Use core management cmdlets for services, processes, files and computers, and verify object types before filtering or formatting output.
- Microsoft.PowerShell.PSResourceGet module: setup and commands
Discover and install modules with Find-PSResource and Install-PSResource, checking repository trust, version constraints and command-name changes.
- Microsoft.PowerShell.Security module: setup and commands
Inspect execution policy, signatures and secure strings with security cmdlets while treating execution policy as a safety feature, not a boundary.
- Microsoft.PowerShell.Host module: setup and commands
Record console sessions with transcripts and interact with the host using Read-Host, Start-Transcript, and Stop-Transcript.
- Microsoft.PowerShell.Utility module: setup and commands
Transform, measure, sort and export objects with Utility cmdlets while keeping formatting commands at the end of the pipeline.
- MicrosoftTeams module: setup and commands
Connect to Microsoft Teams, inspect teams and policies, and account for role permissions and eventual consistency before judging a change unsuccessful.
- NetSecurity module: setup and commands
Inspect Windows Firewall profiles and rules with Get-NetFirewallProfile and Get-NetFirewallRule before changing direction, scope or enforcement.
- NetTCPIP module: setup and commands
Diagnose addresses, routes and TCP connections with Get-NetIPAddress, Get-NetRoute and Get-NetTCPConnection using the correct interface context.
- PSReadLine module: setup and commands
Configure command history, prediction, completion and key handlers with PSReadLine while checking host support and avoiding shared-history surprises.
- PSScriptAnalyzer module: setup and commands
Run Invoke-ScriptAnalyzer with explicit rules and settings, separate style findings from correctness issues and suppress rules only with a reason.
- Pester module: setup and commands
Write repeatable PowerShell tests with Describe, It and Should, then isolate dependencies with mocks that target the command actually called.
- ScheduledTasks module: setup and commands
Inspect task definitions, triggers and principals with Get-ScheduledTask, then verify execution history instead of assuming registration means success.
- Storage module: setup and commands
Inspect physical disks, partitions, volumes and Storage Spaces with Get-Disk and Get-Volume before any destructive initialization or formatting step.
Scripts110 pages
- Audit Hyper-V replication
Get-VMReplication returns the replication configuration for each participating guest, and the projection keeps the VM name with State, Health, and LastReplicationTime.
- Audit PowerShell script block logging
Read the PowerShell ScriptBlockLogging policy registry key with Get-ItemProperty and interpret missing settings before drawing conclusions.
- Audit firewall profiles
Get-NetFirewallProfile returns one object per profile, and Select-Object reports the profile name with Enabled plus the two default action fields.
- Audit inbound firewall block rules
Get-NetFirewallRule is constrained by three parameters at once, returning rules that are enabled, inbound, and set to block.
- Audit offboarding state
A single Get-ADUser call requests Enabled, MemberOf and LastLogonDate for the account named in $Sam.
- Audit privileged groups
An array holds the four group names worth watching, and the loop calls Get-ADGroupMember with -Recursive on each so nested membership is flattened into leaf members.
- Audit users with risky delegation flags
Get-ADUser requests the delegation-related properties explicitly because they are not returned by default.
- Bulk add users to a group from CSV
Import-Csv reads the file into objects with one property per column, and ForEach-Object calls Add-ADGroupMember once per row.
- Capture a terminating error
Get-Item runs with -EA Stop, which promotes its non-terminating error into a terminating one so control transfers into the catch block.
- Check AD replication failures
Get-ADReplicationPartnerMetadata with -Target * and -Scope Domain collects the metadata each controller keeps about its replication partners.
- Check Windows Defender status
Get-MpComputerStatus returns the live state of the Defender engine as a single object.
- Check certificate files in a folder
Get-ChildItem recurses through $Path with a -Filter of *.cer and reports each match with its full path, last write time, and size.
- Check pending reboot indicator
Inspect a Windows pending reboot indicator with PowerShell. Review the specific check and its limits before using it in a wider maintenance workflow.
- Collect hardware summary
Collect CPU model, RAM in GiB, and BIOS version with Get-CimInstance, then combine the results into one PowerShell object.
- Collect hotfix history
Get-HotFix wraps the Win32_QuickFixEngineering class and returns one row per servicing update.
- Collect recent system errors
Query recent System errors with a server-side Get-WinEvent filter. Inspect the event time, ID and provider to focus the investigation.
- Compare DNS answers across servers
The loop asks each server in $DnsServers to resolve $Name and stamps the responding server onto every record with a calculated property.
- Compare a copied file with SHA256
Get-FileHash reads each file using SHA256. LiteralPath treats brackets in filenames literally.
- Compare two directory inventories
Both sides get enumerated with Get-ChildItem into a projection of FullName, Length, and LastWriteTime, and Compare-Object is told to compare on exactly those three properties.
- Connector inventory
Inventory Exchange Online inbound and outbound connectors, including enabled state, connector type, and outbound recipient domains.
- Create a calculated property
Select-Object accepts a hashtable with an n key naming the new column and an e key holding a script block that computes its value.
- Create a custom reporting object
The [pscustomobject] cast applied to a hashtable literal produces one object whose properties are the hashtable keys, in the order they were written.
- Distribution group inventory
Get-DistributionGroup with -ResultSize Unlimited enumerates every distribution and mail-enabled security group, and the projection keeps just the display name and primary SMTP address.
- Distribution group membership audit
The outer enumeration returns every distribution group, and for each one Get-DistributionGroupMember lists its members with its own unlimited result size.
- Explain pipeline members
Get-Process emits its objects and Get-Member consumes them, reporting the type name once and then every property, method, and property set that type exposes.
- Export DNS client configuration
List configured IPv4 DNS servers with Get-DnsClientServerAddress. Pair each interface with its resolver addresses and exclude empty lists.
- Export IPv4 configuration
Get-NetIPAddress limited to -AddressFamily IPv4 returns every address bound to every interface.
- Export OU inventory
Export Active Directory OUs to CSV with their names, distinguished names, and accidental-deletion protection settings.
- Export a time-bounded Entra sign-in report
Review a PowerShell example for exporting recent Microsoft Entra sign-ins. Check access requirements and adapt the query to your reporting task.
- Find Azure resources missing required tags
Inspect Azure resource tags with Get-AzResource and identify resources missing required keys before planning any changes.
- Find Defender exclusions
Get-MpPreference returns the local Defender configuration, and the projection pulls the three exclusion collections covering file paths, process images, and extensions.
- Find Hyper-V checkpoints
Get-VM feeds each guest into Get-VMSnapshot, which returns the checkpoints belonging to that machine.
- Find USB storage devices
Query Win32_DiskDrive for USB storage devices. Report model, device ID, size in bytes, and available serial numbers with PowerShell.
- Find accounts in an unexpected OU
Every user object is retrieved, then Where-Object keeps the ones whose DistinguishedName fails to match a regular expression describing the approved containers.
- Find changed PowerShell files in Git
git diff with --name-only prints paths instead of patch content, and the pathspec arguments after the double dash restrict output to ps1 and psm1 files.
- Find disabled Entra users
The -Filter argument hands accountEnabled eq false to Graph as an OData expression so the service performs the selection.
- Find disconnected adapters
Use Get-NetAdapter to list interfaces whose status is not Up. Include the interface name, status, and driver description for investigation.
- Find duplicate SPNs
Query Active Directory servicePrincipalName values, expand the collections, and group repeated SPNs to investigate duplicate registrations.
- Find duplicate mail addresses
Every user is retrieved with the mail attribute, accounts holding no address are dropped, Group-Object buckets the remainder by address, and only buckets with more than one member survive.
- Find empty directories
Find empty folders with Get-ChildItem and Where-Object. Count hidden and system entries when deciding whether a directory is empty.
- Find empty security groups
Get-ADGroup returns security groups, then ForEach-Object tests each by calling Get-ADGroupMember against it.
- Find enabled users without email
Enabled users are retrieved with the mail attribute requested explicitly, and the intent of the middle stage is to keep only accounts where mail holds nothing.
- Find established endpoints
Group established TCP connections by remote address, then sort by count to find the endpoints with the most concurrent connections.
- Find expiring machine certificates
Find local-machine certificates with an expiry before a 30-day cutoff. Report subject, thumbprint, expiry, and private-key availability.
- Find external forwarding rules
Every mailbox is enumerated, and for each one Get-InboxRule is called against its primary SMTP address with errors suppressed so mailboxes that cannot be reached are skipped quietly.
- Review scheduled tasks with nonzero results
Get-ScheduledTask enumerates every registered task, and piping it into Get-ScheduledTaskInfo attaches the runtime history to each.
- Find guest users
A userType eq 'Guest' filter is evaluated by Graph, with the literal in single quotes because OData string comparisons require them.
- Rank processes by total CPU time
Get-Process emits one process object per running executable, Sort-Object orders them by the CPU property in descending order, and -First 15 trims the tail.
- Find high memory processes
The pipeline sorts Get-Process output on WorkingSet64, the resident set in bytes as reported by the 64-bit counter, then keeps the top fifteen.
- Review inactive enabled AD accounts
A cutoff is calculated ninety days back, then Get-ADUser retrieves enabled accounts and asks for LastLogonDate explicitly because that property is outside the default property set.
- Find listening TCP ports
Get-NetTCPConnection with -State Listen returns only sockets sitting in the listening state rather than the full connection table.
- Find locked-out users
Search-ADAccount -LockedOut asks the directory for accounts currently in a locked state, so the selection happens server-side with no client filtering involved.
- Find Windows disks below a free-space threshold
Query fixed local disks with Get-CimInstance and Win32_LogicalDisk, calculate free space, and identify volumes below the script's threshold.
- Find mailbox forwarding
Get-EXOMailbox runs with -PropertySets All so the forwarding attributes come back, since they sit outside the minimal default set this cmdlet returns.
- Find old VMware snapshots
Find VMware snapshots older than seven days with Get-Snapshot. Report the VM, snapshot name, creation date, and size in GB.
- Find old temporary files
Get-ChildItem walks the current user's temp directory recursively for files only, with -EA SilentlyContinue swallowing the access denials that a deep walk inevitably hits.
- Find processes outside Windows directories
Query Win32_Process with Get-CimInstance to inspect executable paths outside C:\Windows, alongside process names and IDs.
- Review stale AD computer accounts
Find enabled AD computer accounts with a recorded LastLogonDate older than 120 days. Review the evidence before treating an account as unused.
- Find stopped Azure VMs
Filter Azure VM status data for stopped and deallocated machines. Keep the resource group and power state so the two conditions remain distinct.
- Find stopped automatic services
Use Get-Service and Where-Object to find automatic-start services that are not running. Return service names and display names for investigation.
- Find unattached Azure disks
Get-AzDisk enumerates the managed disks in the subscription and Where-Object keeps those whose DiskState reads Unattached.
- Report AD accounts with non-expiring passwords
Get-ADUser filters server-side on PasswordNeverExpires being true and requests the same attribute so the value returns with each object.
- Find users without a department
Enabled accounts come back with the Department attribute requested, the middle stage keeps the ones where it is empty, and the output is narrowed to the account name.
- Find users without a manager
The query pulls enabled users with the Manager attribute requested, filters down to accounts where that attribute is unpopulated, and reports the account name.
- Generate a GPO report
Create an HTML report of domain Group Policy settings with Get-GPOReport -All, including configured settings rather than only GPO names.
- Build a server health report object
Combine server health measurements into a structured PowerShell object that can be inspected, filtered or exported.
- Generate uptime report
Query Win32_OperatingSystem on each computer and calculate uptime from LastBootUpTime. Check unreachable hosts before using the report.
- Inspect PowerShell command lines
A WQL filter restricts Win32_Process to the two PowerShell image names so the selection happens inside the CIM provider rather than in the pipeline.
- Inventory Azure VMs
Get-AzVM with -Status queries each machine's instance view in addition to its model, and that is what populates the PowerState property.
- Inventory Azure resource groups
Get-AzResourceGroup returns every group in the subscription the context points at, and the projection keeps the group name with its location and provisioning state.
- Inventory Azure subscriptions
Get-AzSubscription lists the subscriptions the signed-in identity can see in the current tenant, and the projection keeps name, ID, tenant ID and State.
- Inventory Entra groups
Inventory Entra ID groups with Microsoft Graph PowerShell, selecting the group properties needed for a directory report.
- Inventory Entra users
Get-MgUser with -All pages through the whole directory instead of stopping at the first page, and -Property maps to the underlying $select so only the four requested properties come back.
- Inventory GPOs
Get-GPO -All enumerates every policy object in the domain and the projection keeps the display name with its GUID and both timestamps.
- Inventory Hyper-V VMs
List Hyper-V guests with Get-VM and report state, CPU usage, assigned memory in bytes, and status for each virtual machine.
- Inventory VMware VMs
Get-VM against a connected vCenter returns the guests, and the projection keeps the name with PowerState, NumCpu, MemoryGB, and the VMHost the guest is running on.
- Inventory Windows build information
One Get-CimInstance call against Win32_OperatingSystem returns a single instance per machine.
- Inventory software from Windows uninstall keys
Get-ItemProperty reads the uninstall hives directly, covering both the native path and Wow6432Node so 32-bit packages on a 64-bit host are included.
- Inventory network adapters
Inventory network interfaces with Get-NetAdapter. Report status, link speed, MAC address, and driver description beside each interface name.
- Inventory service principals
List tenant service principals with Microsoft Graph PowerShell. Review application identities and the properties returned by the inventory.
- Investigate account lockouts
Query Security event ID 4740 from the last eight hours. Inspect the timestamp, logging computer, and message for account-lockout evidence.
- Mailbox inventory
Get-EXOMailbox with -ResultSize Unlimited pages through all recipients rather than stopping at the default first thousand.
- Mailbox permissions report
Inspect a mailbox’s access rights and inherited permissions with Get-EXOMailboxPermission before preparing a permissions report.
- Mailbox size report
Use Get-EXOMailboxStatistics to report mailbox item counts and total sizes, then sort the results to inspect the largest mailboxes first.
- Map active TCP connections to processes
Established connections come back from Get-NetTCPConnection, and ForEach-Object builds a fresh [pscustomobject] per row carrying the local port with the owning process name.
- Measure endpoint latency
The loop sends four ICMP probes per target with Test-Connection and pipes the replies into Measure-Object, which computes the average, minimum, and maximum response time.
- Report Azure role assignments
Report Azure role assignments with Get-AzRoleAssignment, including principal identity, role, scope, and object type in the active context.
- Report FSMO role holders
Find all five FSMO role holders with Get-ADForest and Get-ADDomain. Read the forest-wide and domain-specific role properties separately.
- Report direct license counts
Get-MgUser -All requests AssignedLicenses alongside the display name.
- Report domain controllers
List AD domain controllers with their sites, IPv4 addresses, operating systems, and global-catalog status using Get-ADDomainController.
- Report local Administrators members
Get-LocalGroupMember resolves the group membership and returns each principal with two useful qualifiers.
- Report scheduled tasks running under stale accounts
The task inventory is read first, then each configured principal is translated to a SID.
- Retry a transient remote operation
Retry Invoke-Command up to three times with increasing delays. Use terminating error handling and rethrow the final failure.
- Review default routes
Filtering Get-NetRoute to the destination prefix 0.0.0.0/0 returns only the default routes.
- Review unsigned PowerShell scripts in a repository
Check PowerShell script signatures without executing the files. Identify unsigned scripts and review their signature status.
- Run PSScriptAnalyzer over a repo
Scan scripts and modules recursively with Invoke-ScriptAnalyzer, then export rule names, severity, and line numbers to CSV for review.
- Run Pester tests and capture results
Invoke-Pester executes the test files under the tests directory with normal console output, and -PassThru returns the run object instead of only printing to the console.
- SharePoint site inventory
Inventory SharePoint Online site collections with Get-SPOSite -Limit All and inspect the returned site properties.
- Shared mailbox inventory
Passing -RecipientTypeDetails SharedMailbox to Get-EXOMailbox filters at the service rather than in the pipeline, and -ResultSize Unlimited keeps the full result set.
- Summarize computers by OS
Query AD computer operating systems, group matching values, and sort by count to report how many machine accounts use each OS.
- Summarize failed logons
The FilterHashtable pins the Security channel and event ID 4625 with a start time one day back, so the log service performs the selection rather than the pipeline.
- Teams inventory
Use Get-Team to report team names, Microsoft 365 group IDs, visibility, and archived status in a PowerShell inventory.
- Test a TCP port across servers
The loop walks $Computers and calls Test-NetConnection against each with the port held in $Port, capturing the result object.
- Trace DNS resolution across configured resolvers
The script asks each configured IPv4 DNS server directly. That removes the local resolver cache and server-selection ambiguity from the comparison.
- Transport rule inventory
Get-TransportRule returns every rule in the organization and the projection keeps the name with State, Mode, Priority, and Description.
- Use splatting for a CIM query
A hashtable holds parameter names as keys with their values attached, then @params in place of the individual parameters hands the whole set to Get-CimInstance.
- Validate a module manifest
Get-ChildItem finds every psd1 file under the current directory and ForEach-Object runs Test-ModuleManifest against each full path.
- Check whether recent backup files arrived
Check a backup folder for files written since an expected timestamp. Report the twenty newest matching names, sizes, and write times.
- Write a correlation-aware JSON operation log
Each line is a complete JSON object with an ISO-8601 UTC timestamp and one correlation ID.
- Write structured audit records
A [pscustomobject] literal captures the timestamp and host name along with the action, status, and message supplied by the caller.
Troubleshooting26 pages
- AD query is unexpectedly slow
AD query is unexpectedly slow: a wildcard -Filter pulls every object across the wire before Where-Object filters client-side, so cost tracks directory size, not answer size.
- Authenticode signature status changes to HashMismatch
Authenticode signature status changes to HashMismatch: the file bytes changed after the file was signed.
- CIM works locally but not remotely
CIM works locally but not remotely: adding -ComputerName switches the transport to WS-Management on port 5985, which needs the remoting infrastructure in place.
- Certificate is installed but application rejects it
Certificate is installed but the application rejects it: applications check far more than validity - trust chain, key usage, and the binding the application actually reads.
- Command works on one host but not another
Command works on one host but not another: hosts drift over time - different PowerShell versions, module versions, or module paths.
- Connect-AzAccount succeeds but Get-AzResource returns the wrong subscription
Connect-AzAccount succeeds but Get-AzResource returns the wrong subscription: Az PowerShell maintains a current context that may still point at a different subscription.
- Copied files have different SHA256 hashes
Copied files have different SHA256 hashes: hashing compares raw bytes, so any changed byte - line endings, metadata - changes the hash.
- DNS resolves but the application is unreachable
DNS resolves but the application is unreachable: resolution and reachability are independent - a correct record proves only that the record exists.
- Export-Csv output looks wrong
Export-Csv output looks wrong: Format-Table replaces real objects with formatting instructions, which Export-Csv then faithfully serializes instead of the data.
- GPO processing is slow
GPO processing is slow: policy processing is a sequence of directory lookups and SYSVOL file reads, inheriting every DNS and domain-controller location delay.
- Get-ADUser is not recognized
Get-ADUser is not recognized: the AD cmdlets live in the ActiveDirectory module, which ships with the RSAT feature - not with PowerShell itself.
- Locked user account keeps locking
Locked user account keeps locking: lockout counters accumulate failures from every source - a stale cached password on a service, scheduled task, or phone mail.
- Module imports but command is missing
Module imports but command is missing: the manifest's FunctionsToExport controls what gets exported, so the command may be excluded deliberately or by accident.
- Null-valued expression
Null-valued expression: a cmdlet that finds nothing returns nothing rather than raising an error, so the next line operates on $null and fails only when reaching inside it.
- Parallel script is slower than serial
Parallel script is slower than serial: every runspace pays startup and module-import costs that exceed the savings for small units of work.
- Parameter binding fails
Parameter binding fails: PowerShell resolves parameter sets before executing, so a combination spanning two mutually exclusive sets is unresolvable.
- PowerShell JSON log contains truncated nested data
PowerShell JSON log contains truncated nested data: ConvertTo-Json limits serialization depth, so deeper nested properties are dropped.
- PowerShell job completes but no result is visible
PowerShell job completes but no result is visible: job output is buffered on the job object until Receive-Job collects it - it never reaches the console on its own.
- REST call returns certificate or TLS errors
REST call returns certificate or TLS errors: the .NET stack validates the chain, hostname, and expiry before any request leaves; Windows PowerShell 5.1.
- Remote file share access fails from a remoting session
Remote file share access fails from a remoting session: credentials cannot forward to a second hop by default - the remote session holds a network logon token with no reusable secret.
- Resolve-DnsName works against one DNS server only
Resolve-DnsName works against one DNS server only: the DNS servers do not currently hold equivalent data.
- Scheduled task returns 0x8007052E
Scheduled task returns 0x8007052E: Windows rejected the supplied logon credentials.
- Scheduled task works interactively but fails when scheduled
Scheduled task works interactively but fails when scheduled: a task runs under its configured identity, so mapped drives, stored credentials, and profile.
- Script execution is blocked
Script execution is blocked: execution policy is a per-scope setting - the effective value is the first one set in a fixed precedence order that puts machine policy above user choice.
- Service is running but application is down
Service is running but the application is down: the service control manager tracks whether a process started, not whether the code inside is doing anything.
- WinRM remoting fails
Fix PowerShell WinRM remoting failures with checks for connectivity, configuration and access. Trace the connection error and verify the result before retrying.
Error reference15 pages
- PowerShell: access is denied
Check the calling identity, elevation and resource permissions when a PowerShell operation returns access denied.
- PowerShell: cannot bind a parameter
Check argument types, parameter sets and pipeline input when PowerShell cannot bind a parameter.
- PowerShell: cim query failed
Investigate CIM class names, namespaces, permissions and connectivity when Get-CimInstance fails.
- PowerShell: command not recognized
Check spelling, command discovery and required modules when PowerShell says a command is not recognized.
- PowerShell: file read or write failed
Check file locks, directories, free space and storage connectivity when a PowerShell file operation fails.
- PowerShell: invalid json input
Inspect the original response and JSON structure when ConvertFrom-Json cannot parse its input.
- PowerShell: module import failed
Inspect module prerequisites, manifest settings and dependencies when Import-Module cannot load a module.
- PowerShell: module not found
Check module installation, name and PSModulePath when PowerShell cannot find the requested module.
- PowerShell: null value or missing property
Check lookup results and object properties before accessing a member that may be missing or null.
- PowerShell: operation is not valid
Inspect object state, method requirements and collection changes when PowerShell reports an invalid operation.
- PowerShell: path or item not found
Find incorrect paths, unexpected working directories and wildcard interpretation when PowerShell cannot locate an item.
- PowerShell: remoting connection failed
Check the remoting transport, target address, authentication and endpoint when a PowerShell remote connection fails.
- PowerShell: running scripts is disabled
Check execution-policy scopes, script signatures and downloaded-file marks when a PowerShell script is blocked.
- PowerShell: unexpected token or missing delimiter
Find mismatched quotes, brackets and incomplete expressions when a PowerShell script fails to parse.
- PowerShell: web request failed
Separate HTTP status errors from DNS, proxy, TLS and timeout failures when a PowerShell web request fails.
Knowledge checks13 pages
- Functions capstone: defend your automation
Capstone assessment for the PowerShell Functions lesson: six checks — predict output, diagnose an output bug, judge pipeline statements, choose the fix, verify with Pester.
- How do you get the smallest three processes by memory?
Test how do you get the smallest three processes by memory in PowerShell. Compare the choices and understand why the answer is correct.
- What does Get-Member tell you?
Test what does Get-Member tell you in PowerShell. Compare the choices and understand why the answer is correct.
- What does a matching SHA256 file hash establish?
Test what does a matching SHA256 file hash establish in PowerShell. Compare the choices and understand why the answer is correct.
- What is JEA?
Test your understanding of Just Enough Administration in PowerShell. Compare answer choices and review the explanation of how JEA limits operator capabilities.
- What is Pester?
Test your understanding of Pester, the PowerShell testing framework. Compare the answer choices and read the explanation to see why the correct option fits.
- What is ValueFromPipelineByPropertyName?
Test what is ValueFromPipelineByPropertyName in PowerShell. Compare the choices and understand why the answer is correct.
- When should you measure performance?
Test when should you measure performance in PowerShell. Compare the choices and understand why the answer is correct.
- Why avoid hard-coded passwords?
Test why you should avoid hard-coded passwords in PowerShell. Compare the choices and understand why the answer is correct.
- Why can catch miss an error?
Test why can catch miss an error in PowerShell. Compare the choices and understand why the answer is correct.
- Why should formatting usually be late in a pipeline?
Test why should formatting usually be late in a pipeline in PowerShell. Compare the choices and understand why the answer is correct.
- Why use PSCustomObject in reports?
Test why use PSCustomObject in reports in PowerShell. Compare the choices and understand why the answer is correct.
- Why use server-side AD filtering?
Test why use server-side AD filtering in PowerShell. Compare the choices and understand why the answer is correct.
Interview questions34 pages
- A cmdlet is not recognized. How do you troubleshoot it without reinstalling everything?
Check command resolution, installed modules, PSModulePath, PowerShell edition, architecture and import errors.
- Explain PowerShell objects instead of text.
Explain object pipelines, discover properties with Get-Member, and keep structured data intact until export or display.
- How do single-quoted and double-quoted strings differ in PowerShell ?
Double-quoted strings expand variables and subexpressions; single-quoted strings are literal except for the escape rules needed to represent a quote.
- How do you decide whether to use PowerShell 5.1 or PowerShell 7 for enterprise automation?
Start from module and platform compatibility, authentication requirements, remoting behavior and support policy.
- How do you design useful logging for an administrative PowerShell script?
Log decisions, targets, start/end times, correlation identifiers, errors and verification results.
- How do you discover a command when you know the task but not the cmdlet name?
Use Get-Command with Verb, Noun, Module or wildcard filters, then inspect Get-Help examples and syntax before running anything that changes state.
- How do you keep Azure or Microsoft Graph automation in the correct tenant and subscription?
Keep Azure and Microsoft Graph automation in the intended tenant: set context explicitly, check permissions, and isolate concurrent operations.
- How do you make a large PowerShell pipeline faster without making it harder to trust?
Speed up PowerShell pipelines by measuring queries, filtering at the source, reducing remote calls, and comparing results with a known baseline.
- How do you make administrative PowerShell idempotent?
Design scripts that compare current and desired state, change only what differs, and report repeatable administrative outcomes.
- How should PowerShell automation handle credentials and secrets?
Use the organization's approved secret store or workload identity, request the narrowest scope, keep secrets out of source and logs, and rotate secrets on a schedule.
- How should a PowerShell function return data for another command to consume?
Write structured objects to the success stream and keep display formatting outside the function.
- How would you check Active Directory replication health before making a directory change?
Check AD replication partners, DNS, time, and affected naming contexts before making directory changes. Verify recovery across domain controllers.
- How would you design a safe bulk-change PowerShell runbook?
Plan bulk PowerShell changes with target previews, ShouldProcess, checkpoints, partial-failure handling, and independent result verification.
- How would you design cross-tenant PowerShell automation for Microsoft cloud services?
Design cross-tenant PowerShell automation with separate identities, explicit context, bounded concurrency, and retries that avoid duplicate changes.
- How would you design safe WhatIf and Confirm behavior in a function?
Use SupportsShouldProcess on an advanced function and call $PSCmdlet.ShouldProcess around the state-changing operation.
- How would you diagnose the PowerShell remoting double-hop problem?
First prove the first remote connection works, then identify whether the remote session must authenticate to a second resource.
- How would you govern PowerShell used by many teams without blocking useful automation?
Govern shared PowerShell automation with controlled modules, review rules, CI checks, consistent logging, and separate privileged runbooks.
- How would you structure a production PowerShell module?
Structure a maintainable PowerShell module with a manifest, deliberate exports, stable object output, tests and versioned releases.
- How would you troubleshoot WinRM?
Work through WinRM connectivity, listeners, authentication and endpoint authorization without weakening security defaults.
- How would you troubleshoot slow AD queries?
Diagnose slow AD queries by measuring scope, server-side filters, returned properties, connectivity and repeated lookups.
- How would you use JEA to reduce privilege in an operations team?
Use JEA endpoints and role capabilities to limit administrative commands. Choose the execution identity, audit sessions, and test denied operations.
- What are common mistakes when importing and exporting CSV with PowerShell ?
Imported CSV values begin as strings, headers become property names, and Export-Csv should receive objects before formatting.
- What does $_ mean inside a PowerShell pipeline?
$_ is the current pipeline object inside contexts such as Where-Object and ForEach-Object.
- What is splatting?
Explain PowerShell splatting, named parameter hashtables, conditional options and the difference between $params and @params.
- What is the difference between a terminating and non-terminating error?
A terminating error stops the current operation and can be caught directly.
- What observability would you require from an enterprise PowerShell automation platform?
Capture run identity, version, inputs or safe hashes, targets, timing, decisions, errors, retries and verification results with a correlation ID.
- What should a Pester test strategy cover for production PowerShell automation?
Plan Pester coverage for logic, parameter contracts, errors, and real integrations. Learn where mocks help and where acceptance checks are needed.
- When should PowerShell not be the primary automation mechanism?
Evaluate PowerShell against the workload: runtime availability, desired-state management, orchestration and application requirements.
- When should you use -LiteralPath instead of -Path?
Use LiteralPath when the path must be interpreted exactly, especially when names contain wildcard characters such as brackets.
- When would you use Select-Object rather than Format-Table?
Choose Select-Object for reusable data and Format-Table for display. Understand why formatting before Export-Csv causes problems.
- Why avoid aliases in shared PowerShell scripts?
Aliases are convenient interactively, but shared scripts should favor full command and parameter names so intent survives code review, different profiles and hosts.
- Why can a PowerShell script work interactively but fail as a scheduled task?
The task may run under a different identity, engine, working directory, profile, environment, network context or permission scope.
- Why does ErrorAction Stop matter in try/catch?
Learn why catch can miss a PowerShell error, how ErrorAction Stop changes cmdlet behavior, and where finally belongs.
- Why is execution policy not a security boundary?
Execution policy is a safety feature that controls script-loading behavior and trust signals.
Home1 pages
- PowerShell Genie — Learn PowerShell by doing
Learn PowerShell with object and pipeline lessons, command examples, admin scripts, and browser exercises using sample data.