PowerShell Genie

PowerShell command reference

Find command syntax, examples and expected output. Browser labs evaluate supported commands against fictional data; other examples are for inspection.

Reference Windows PowerShell 5.1 and PowerShell 7

Active Directory & identity 25 commands

Manage users, groups, computers, OUs, and domains with the Active Directory cmdlets.

Add-ADGroupMember

Add

Use Add-ADGroupMember to add users, computers or other groups to an Active Directory group. See its syntax, examples, and output.

4 examples

Disable-ADAccount

Disable

Use Disable-ADAccount to disable an Active Directory user or computer account, blocking sign-in while keeping the object.

4 examples

Enable-ADAccount

Enable

Use Enable-ADAccount to enable a disabled Active Directory user or computer account. Review syntax and sample output, then try an example in the browser lab.

4 examples

Get-ADComputer

Get

Use Get-ADComputer to retrieve computer accounts from Active Directory. Review syntax and sample output, then try an example in the browser lab.

4 examples

Get-ADDomain

Get

Use Get-ADDomain to return information about an Active Directory domain, including its FSMO role holders and naming contexts.

4 examples

Get-ADDomainController

Get

Use Get-ADDomainController to retrieve domain controllers in a domain or forest, with their roles, site and status. See its syntax, examples, and output.

4 examples

Get-ADForest

Get

Use Get-ADForest to return information about an Active Directory forest, including its domains, sites and forest-level role holders.

4 examples

Get-ADGroup

Get

Use Get-ADGroup to retrieve security and distribution groups from Active Directory. Review syntax and sample output, then try an example in the browser lab.

4 examples

Get-ADGroupMember

Get

Use Get-ADGroupMember to list the members of an Active Directory group, optionally expanding nested groups. See its syntax, examples, and output.

3 examples

Get-ADObject

Get

Use Get-ADObject to retrieve any object from Active Directory regardless of type, including deleted objects. See its syntax, examples, and output.

4 examples

Get-ADOrganizationalUnit

Get

Use Get-ADOrganizationalUnit to list Active Directory OUs with their distinguished names — the containers Group Policy and delegated administration target.

4 examples

Get-ADReplicationFailure

Get

Use Get-ADReplicationFailure to report AD replication failures per domain controller, so an unreplicated change stops looking like a permissions problem.

4 examples

Get-ADReplicationPartnerMetadata

Get

Use Get-ADReplicationPartnerMetadata to show when each replication partner last succeeded — the complement to Get-ADReplicationFailure.

4 examples

Get-ADUser

Get

Use Get-ADUser to retrieve user accounts from Active Directory by identity, filter or LDAP query. See its syntax, examples, and output.

4 examples

Move-ADObject

Move

Use Move-ADObject to move an Active Directory object to a different organizational unit or container. See its syntax, examples, and output.

4 examples

New-ADComputer

New

Use New-ADComputer to create a computer account in Active Directory before the machine joins the domain. See its syntax, examples, and output.

4 examples

New-ADGroup

New

Use New-ADGroup to create a security or distribution group in Active Directory. Review syntax and sample output, then try an example in the browser lab.

4 examples

New-ADUser

New

Use New-ADUser to create an Active Directory user account with identity attributes like -Name, -SamAccountName, -UserPrincipalName, and -AccountPassword.

3 examples

Remove-ADGroupMember

Remove

Use Remove-ADGroupMember to remove members from an Active Directory group. Review syntax and sample output, then try an example in the browser lab.

4 examples

Remove-ADUser

Remove

Use Remove-ADUser to delete an Active Directory user account. Confirm the identity first — deletion is immediate and hard to undo.

4 examples

Search-ADAccount

Search

Use Search-ADAccount to find accounts matching a built-in condition such as locked out, disabled, expired or inactive. See its syntax, examples, and output.

4 examples

Set-ADComputer

Set

Use Set-ADComputer to modify attributes on an existing Active Directory computer account. See its syntax, examples, and output.

4 examples

Set-ADUser

Set

Use Set-ADUser to modify attributes on an existing Active Directory user account. Review syntax and sample output, then try an example in the browser lab.

4 examples

Start-ADSyncSyncCycle

Start

Use Start-ADSyncSyncCycle to request a Microsoft Entra Connect Sync cycle after checking scheduler state and the intended server.

2 examples

Unlock-ADAccount

Unlock

Use Unlock-ADAccount to clear the lockout on an Active Directory account after too many failed sign-in attempts. Review examples and related commands.

4 examples

Files, folders & storage 22 commands

Navigate drives, read and write files, and work with archives and ACLs.

Add-Content

Add

Use Add-Content to append a value to the end of a file, leaving existing content in place. See its syntax, examples, and output.

4 examples

Clear-Content

Clear

Use Clear-Content to empty a file without deleting it, leaving a zero-length file behind. See its syntax, examples, and output.

4 examples

Compress-Archive

Compress

Use Compress-Archive to create a zip archive from files or folders. Review syntax and sample output, then try an example in the browser lab.

3 examples

Copy-Item

Copy

Use Copy-Item to copy files or directories. Review path handling, recursive copies and examples before choosing a destination.

3 examples

Expand-Archive

Expand

Use Expand-Archive to extract the contents of a zip archive to a folder. Review syntax and sample output, then try an example in the browser lab.

3 examples

Get-Acl

Get

Use Get-Acl to return the security descriptor of a file, folder, registry key or other securable object. See its syntax, examples, and output.

2 examples

Get-ChildItem

Get

Use Get-ChildItem to get the items and child items in one or more specified locations. Review syntax and sample output, then try an example in the browser lab.

4 examples

Get-Content

Get

Use Get-Content to get the content of an item at the specified location, most commonly a text file. See its syntax, examples, and output.

3 examples

Get-FileHash

Get

Use Get-FileHash to compute a cryptographic hash of a file, defaulting to SHA256. Review syntax and sample output, then try an example in the browser lab.

4 examples

Get-Item

Get

Use Get-Item to return the item at a path — file, folder, registry key, or any provider item — to inspect its properties.

4 examples

Get-PSDrive

Get

Use Get-PSDrive to list the drives available in the session, including those that are not filesystems. See its syntax, examples, and output.

4 examples

Join-Path

Join

Use Join-Path to combine path segments into one path using the correct separator for the platform. See its syntax, examples, and output.

4 examples

Move-Item

Move

Use Move-Item to move a file or directory to a new location, and rename it if you change the leaf name. See its syntax, examples, and output.

4 examples

New-Item

New

Use New-Item to create a new item, such as a file, directory, registry key, or provider-specific object. See its syntax, examples, and output.

4 examples

Out-File

Out

Use Out-File to write the formatted text representation of objects to a file. Review syntax and sample output, then try an example in the browser lab.

3 examples

Remove-Item

Remove

Use Remove-Item to delete files, folders, registry keys, or other provider items; -Recurse and -Force clear non-empty trees.

3 examples

Resolve-Path

Resolve

Use Resolve-Path to turn a relative path or a wildcard into one or more full paths, failing if nothing matches. See its syntax, examples, and output.

4 examples

Set-Acl

Set

Use Set-Acl to apply a security descriptor to a file, folder or registry key. Review syntax and sample output, then try an example in the browser lab.

4 examples

Set-Content

Set

Use Set-Content to replace the entire contents of a file with the value you supply. Review syntax and sample output, then try an example in the browser lab.

4 examples

Split-Path

Split

Use Split-Path to return one part of a path: the parent directory, the file name, the extension, or the qualifier. See its syntax, examples, and output.

4 examples

Test-Path

Test

Use Test-Path to return $true or $false for whether a path exists — the guard to run before reading, writing, or deleting.

3 examples

Rename-Item

Other

Use Rename-Item to rename files, folders, and registry keys, or bulk-rename many files at once.

3 examples

System: processes, services & computer 20 commands

Inspect and control processes, services, and the local machine.

Get-CimInstance

Get

Use Get-CimInstance to get instances of CIM classes from a CIM server. See CimCmdlets module requirements and examples. See its syntax, examples, and output.

3 examples

Get-ComputerInfo

Get

Use Get-ComputerInfo to return a single object with over a hundred properties describing the operating system and hardware.

4 examples

Get-Counter

Get

Read Windows performance counters with Get-Counter. Discover localized paths, choose sample intervals and counts, and inspect CounterSamples.

4 examples

Get-HotFix

Get

Use Get-HotFix to list installed updates that were delivered as hotfix packages. Review syntax and sample output, then try an example in the browser lab.

4 examples

Get-Process

Get

Use Get-Process to get the processes that are running on the local computer. Review syntax and sample output, then try an example in the browser lab.

3 examples

Get-Service

Get

Use Get-Service to get objects that represent services on a Windows computer, including running and stopped services. See its syntax, examples, and output.

4 examples

Get-WinEvent

Get

Use Get-WinEvent to get events from event logs and event tracing log files on local and remote computers. See its syntax, examples, and output.

4 examples

Restart-Computer

Restart

Reboot a local or remote computer with Restart-Computer. Preview targets with -WhatIf and use -Wait for remote Windows systems.

2 examples

Restart-Service

Restart

Use Restart-Service to stop and then start one or more Windows services. Review syntax and sample output, then try an example in the browser lab.

3 examples

Set-Service

Set

Use Set-Service to start, stop or suspend a service, and change service properties such as StartupType and DisplayName. See its syntax, examples, and output.

3 examples

Start-Process

Start

Use Start-Process to launch an executable or open a file with its associated program. Review syntax and sample output, then try an example in the browser lab.

4 examples

Start-Service

Start

Use Start-Service to start a stopped Windows service by name or display name. Review syntax and sample output, then try an example in the browser lab.

3 examples

Stop-Process

Stop

Use Stop-Process to stop running processes by name or ID; -Force ends processes that ignore a normal stop request. See its syntax, examples, and output.

4 examples

Stop-Service

Stop

Use Stop-Service to stop a running Windows service; -Force also stops services that depend on it. See its syntax, examples, and output.

3 examples

Wait-Process

Wait

Use Wait-Process to block until one or more processes exit, or until a timeout expires. Review syntax and sample output, then try an example in the browser lab.

4 examples

Get-EventLog

Get

Use Get-EventLog to read the System, Application, and Security logs, filtered by newest, type, or source.

3 examples

Get-WindowsFeature

Get

Use Get-WindowsFeature to list the roles and features installed on a Windows Server and check a specific role.

3 examples

Install-WindowsFeature

Other

Use Install-WindowsFeature to install a Windows Server role or feature, such as AD DS or IIS, with its management tools.

3 examples

Get-ItemProperty

Get

Use Get-ItemProperty to read registry values from a key without opening regedit.

3 examples

Set-ItemProperty

Set

Use Set-ItemProperty to write registry values and set properties on files and folders.

3 examples

Objects & the pipeline 11 commands

Shape, filter, measure, and inspect the objects flowing through a pipeline.

Compare-Object

Compare

Use Compare-Object to compare two sets of objects and report which items are only in one of them. See its syntax, examples, and output.

3 examples

ForEach-Object

ForEach

Use ForEach-Object to perform an operation on each item in a collection of input objects. See Microsoft.PowerShell.Utility module requirements and examples.

3 examples

Get-Member

Get

Use Get-Member to list an object's properties and methods — the fastest way to discover what pipeline output can do. See its syntax, examples, and output.

4 examples

Group-Object

Group

Use Group-Object to group objects that share a value for one or more properties, and count each group. See its syntax, examples, and output.

4 examples

Measure-Object

Measure

Use Measure-Object to count objects, or calculate sum, average, minimum and maximum for a numeric property. See its syntax, examples, and output.

4 examples

Select-Object

Select

Use Select-Object to keep only chosen properties, take the first N objects, or expand one property into its values. See its syntax, examples, and output.

4 examples

Sort-Object

Sort

Use Sort-Object to order objects by property, ascending by default or -Descending; -Unique drops duplicates. See its syntax, examples, and output.

3 examples

Tee-Object

Tee

Use Tee-Object to pass objects along the pipeline while also saving them to a file or a variable. See its syntax, examples, and output.

4 examples

Where-Object

Where

Use Where-Object to select objects from a collection based on their property values. See Microsoft.PowerShell.Utility module requirements and examples.

4 examples

Add-Member

Other

Use Add-Member to add a property or method to an existing object for custom reports.

3 examples

New-Object

New

Use New-Object to create .NET objects, COM objects, and custom PSObjects.

3 examples

Azure & Microsoft 365 24 commands

Manage Azure resources plus Exchange Online, SharePoint, and Teams.

Connect-AzAccount

Connect

Use Connect-AzAccount to sign in to Azure and verify the tenant and subscription context. See Az module requirements and examples.

2 examples

Connect-ExchangeOnline

Connect

Use Connect-ExchangeOnline to connect to Exchange Online and verify the administrator session. See ExchangeOnlineManagement module requirements and examples.

2 examples

Get-AzContext

Get

Use Get-AzContext to inspect the active Azure account, tenant and subscription. See Az module requirements and examples.

2 examples

Get-AzDisk

Get

Use Get-AzDisk to inventory Azure managed disks and inspect attachment state. See Az module requirements and examples. See its syntax, examples, and output.

2 examples

Get-AzKeyVault

Get

Use Get-AzKeyVault to list Azure vault resources and distinguish access to secret values. See Az module requirements and examples.

2 examples

Get-AzResource

Get

Use Get-AzResource to inventory Azure resources by resource group and resource type. See Az module requirements and examples.

2 examples

Get-AzResourceGroup

Get

Use Get-AzResourceGroup to query Azure resource groups and inspect location and tags. See Az module requirements and examples.

2 examples

Get-AzRoleAssignment

Get

Use Get-AzRoleAssignment to query Azure role assignments by identity, scope and role. See Az module requirements and examples.

2 examples

Get-AzStorageAccount

Get

Use Get-AzStorageAccount to inventory Azure storage accounts and inspect configuration. See Az module requirements and examples.

2 examples

Get-AzSubscription

Get

Use Get-AzSubscription to list accessible Azure subscriptions and inspect their tenant IDs. See Az module requirements and examples.

2 examples

Get-AzVM

Get

Use Get-AzVM to retrieve Azure VM configuration and check power state with Status. See Az module requirements and examples.

2 examples

Get-DistributionGroup

Get

Use Get-DistributionGroup to list distribution groups and mail-enabled security groups. See ExchangeOnlineManagement module requirements and examples.

2 examples

Get-DistributionGroupMember

Get

Use Get-DistributionGroupMember to list a distribution group's direct members; nested groups are separate objects. See its syntax, examples, and output.

2 examples

Get-EXOMailbox

Get

Use Get-EXOMailbox to inventory Exchange Online mailboxes with explicit properties. See ExchangeOnlineManagement module requirements and examples.

2 examples

Get-EXOMailboxPermission

Get

Use Get-EXOMailboxPermission to inspect mailbox permissions — User, AccessRights, IsInherited and Deny together. See its syntax, examples, and output.

2 examples

Get-EXOMailboxStatistics

Get

Use Get-EXOMailboxStatistics to return mailbox storage statistics such as TotalItemSize. See its syntax, examples, and output.

2 examples

Get-InboundConnector

Get

Use Get-InboundConnector to inspect inbound mail connectors and their sender restrictions. See ExchangeOnlineManagement module requirements and examples.

2 examples

Get-InboxRule

Get

Use Get-InboxRule to inspect mailbox inbox rules, including hidden rules and forwarding. See ExchangeOnlineManagement module requirements and examples.

2 examples

Get-OutboundConnector

Get

Use Get-OutboundConnector to inspect outbound mail connectors and recipient routing settings. See ExchangeOnlineManagement module requirements and examples.

2 examples

Get-SPOSite

Get

Use Get-SPOSite to inventory SharePoint Online site collections and check query limits. Review syntax and sample output, then try an example in the browser lab.

2 examples

Get-SPOUser

Get

Use Get-SPOUser to list users in a SharePoint site collection and check access assumptions. See its syntax, examples, and output.

2 examples

Get-Team

Get

Use Get-Team to inventory Microsoft Teams and check account visibility limits. See MicrosoftTeams module requirements and examples.

2 examples

Get-TransportRule

Get

Use Get-TransportRule to inspect Exchange mail-flow rules, priorities, conditions and modes. See ExchangeOnlineManagement module requirements and examples.

2 examples

Set-AzContext

Set

Use Set-AzContext to select and verify the Azure subscription and tenant for later commands. See Az module requirements and examples.

2 examples

Microsoft Graph 9 commands

Work with Entra ID users, groups, and service principals through Graph.

Connect-MgGraph

Connect

Use Connect-MgGraph to connect to Microsoft Graph with delegated or app-only authentication. See Microsoft.Graph module requirements and examples.

2 examples

Get-MgApplication

Get

Use Get-MgApplication to list app registrations and inspect credential expiry in Microsoft Graph. See its syntax, examples, and output.

2 examples

Get-MgAuditLogSignIn

Get

Use Get-MgAuditLogSignIn to query Entra sign-in logs with date filters and pagination. See Microsoft.Graph module requirements and examples.

2 examples

Get-MgGroup

Get

Use Get-MgGroup to list Microsoft Graph groups and distinguish their membership types. See Microsoft.Graph module requirements and examples.

2 examples

Get-MgGroupMember

Get

Use Get-MgGroupMember to enumerate direct Microsoft Graph group members with pagination. See Microsoft.Graph module requirements and examples.

2 examples

Get-MgServicePrincipal

Get

Use Get-MgServicePrincipal to list tenant service principals and distinguish object IDs from application IDs. See its syntax, examples, and output.

2 examples

Get-MgSubscribedSku

Get

Use Get-MgSubscribedSku to compare purchased and consumed Microsoft 365 license units. See Microsoft.Graph module requirements and examples.

2 examples

Get-MgUser

Get

Use Get-MgUser to query Microsoft Graph users with pagination and explicit properties. See Microsoft.Graph module requirements and examples.

2 examples

Get-MgUserAuthenticationMethod

Get

Use Get-MgUserAuthenticationMethod to list a user's registered authentication methods. Review syntax and sample output, then try an example in the browser lab.

2 examples

Networking 14 commands

Adapters, IP configuration, DNS, firewall rules, and web requests.

Get-DnsClientServerAddress

Get

Use Get-DnsClientServerAddress to show the DNS servers configured per network interface. See its syntax, examples, and output.

4 examples

Get-NetAdapter

Get

Use Get-NetAdapter to list the network adapters on a Windows machine with their status, speed and MAC address. See its syntax, examples, and output.

4 examples

Get-NetFirewallRule

Get

Use Get-NetFirewallRule to list Windows Firewall rules with their direction, action and enabled state. See its syntax, examples, and output.

2 examples

Get-NetIPAddress

Get

Use Get-NetIPAddress to list the IP addresses configured on the machine's interfaces. Review syntax and sample output, then try an example in the browser lab.

4 examples

Get-NetIPConfiguration

Get

Use Get-NetIPConfiguration to return a per-interface summary combining IP address, gateway and DNS servers. See its syntax, examples, and output.

4 examples

Get-NetRoute

Get

Use Get-NetRoute to list the machine's IP routing table entries with their destinations and metrics. See its syntax, examples, and output.

4 examples

Get-NetTCPConnection

Get

Use Get-NetTCPConnection to list TCP connections and listening ports with the owning process id. See its syntax, examples, and output.

4 examples

Invoke-RestMethod

Invoke

Use Invoke-RestMethod to call a REST endpoint and convert the JSON or XML response into PowerShell objects automatically.

4 examples

Invoke-WebRequest

Invoke

Use Invoke-WebRequest to fetch a URL and return the full response: status code, headers, and the raw or parsed content. See its syntax, examples, and output.

4 examples

Resolve-DnsName

Resolve

Use Resolve-DnsName to query DNS for a name or address and return the records, bypassing the local cache when asked. See its syntax, examples, and output.

4 examples

Set-NetFirewallRule

Set

Use Set-NetFirewallRule to change properties of existing Windows Firewall rules. Review syntax and sample output, then try an example in the browser lab.

2 examples

Test-NetConnection

Test

Use Test-NetConnection to test connectivity to a host, optionally on a specific TCP port, and report the route and DNS resolution.

4 examples

Test-Connection

Other

Use Test-Connection to ping a host, test a TCP port, and get a true-or-false answer for scripts.

3 examples

New-NetFirewallRule

New

Use New-NetFirewallRule to create a Windows Firewall rule to allow or block traffic.

3 examples

Security, policy & access 10 commands

Execution policy, code signatures, and local users and groups.

Get-Credential

Get

Use Get-Credential to securely prompt for a username and password as a PSCredential object.

3 examples

ConvertTo-SecureString

Other

Use ConvertTo-SecureString to turn plain text into a SecureString for credentials, or decrypt a stored one.

3 examples

New-LocalUser

New

Use New-LocalUser to create a local Windows user account with a secure password and expiry options.

3 examples

Remoting, jobs & sessions 13 commands

Run commands on remote machines and manage background jobs.

Enter-PSSession

Enter

Use Enter-PSSession to start an interactive remoting session, redirecting your prompt to a remote computer. See its syntax, examples, and output.

4 examples

Get-CimSession

Get

Use Get-CimSession to list the CIM sessions open in the current PowerShell session. Review syntax and sample output, then try an example in the browser lab.

4 examples

Get-Job

Get

Use Get-Job to list the jobs in the session with their current state. Review syntax and sample output, then try an example in the browser lab.

4 examples

Get-PSSession

Get

Use Get-PSSession to list the PSSessions in the current session, or those available on a remote computer. See its syntax, examples, and output.

4 examples

New-CimSession

New

Use New-CimSession to create a reusable CIM session to a remote computer for use with the CIM cmdlets. See its syntax, examples, and output.

4 examples

New-PSSession

New

Use New-PSSession to open a persistent connection to a remote computer and return a session object. See its syntax, examples, and output.

4 examples

Receive-Job

Receive

Use Receive-Job to collect the output of a job and, by default, remove it from the job's buffer. See its syntax, examples, and output.

3 examples

Remove-CimSession

Remove

Use Remove-CimSession to close CIM sessions and release their connections. Review syntax and sample output, then try an example in the browser lab.

4 examples

Remove-Job

Remove

Use Remove-Job to delete a job from the session, discarding any output it still holds. Review syntax and sample output, then try an example in the browser lab.

3 examples

Remove-PSSession

Remove

Use Remove-PSSession to close a PSSession and release the resources it holds on the remote computer. See its syntax, examples, and output.

4 examples

Start-Job

Start

Use Start-Job to run a script block in a separate background process and return a job object immediately. See its syntax, examples, and output.

4 examples

Start-ThreadJob

Start

Use Start-ThreadJob to run a script block on a thread inside the current process and return a job object. See its syntax, examples, and output.

4 examples

Stop-Job

Stop

Use Stop-Job to stop a running job, leaving it in the session so partial output can still be collected. See its syntax, examples, and output.

3 examples

Text, data & formatting 9 commands

Strings, CSV, JSON, XML, and display formatting.

Select-String

Other

Use Select-String to search files and text for a pattern, like grep, with file and line numbers.

3 examples

Shell, modules & session 34 commands

Help, history, variables, modules, transcripts, and the session itself.

Find-Module

Find

Use Find-Module to search a registered repository for modules without installing anything. See its syntax, examples, and output.

4 examples

Get-Alias

Get

Use Get-Alias to list the aliases defined in the session, or resolve an alias to the command it points at. See its syntax, examples, and output.

4 examples

Get-Command

Get

Use Get-Command to get information about PowerShell commands, including cmdlets, aliases, functions, filters, scripts, applications, and external commands.

4 examples

Get-Date

Get

Use Get-Date to return the current date and time, or convert and format a date you supply. See its syntax, examples, and output.

3 examples

Get-Error

Get

Use Get-Error to display the most recent errors in full detail, including nested exceptions and invocation information. See its syntax, examples, and output.

4 examples

Get-Help

Get

Look up syntax, parameters and examples for a PowerShell command. Use the help output to understand a command before running it.

4 examples

Get-History

Get

Use Get-History to return the commands run in the current session, with an id for each. Review syntax and sample output, then try an example in the browser lab.

3 examples

Get-InstalledModule

Get

Use Get-InstalledModule to list modules installed by Install-Module, with the version and repository they came from. See its syntax, examples, and output.

4 examples

Get-Location

Get

Use Get-Location to return the current working directory for the session. Review syntax and sample output, then try an example in the browser lab.

4 examples

Get-Module

Get

Use Get-Module to list modules loaded in the session, or with -ListAvailable those installed and ready to load. See its syntax, examples, and output.

4 examples

Get-Random

Get

Use Get-Random to return a random number, or pick random items from a collection. Review syntax and sample output, then try an example in the browser lab.

4 examples

Get-Variable

Get

Use Get-Variable to list the variables in the current scope, or retrieve one by name. Review syntax and sample output, then try an example in the browser lab.

4 examples

Import-Module

Import

Use Import-Module to load a module into the session so its commands are available. Review syntax and sample output, then try an example in the browser lab.

4 examples

Install-Module

Install

Use Install-Module to download a module from a registered repository and install it for the current user or all users. See its syntax, examples, and output.

4 examples

Invoke-Command

Invoke

Use Invoke-Command to run a command or script block on one or more remote computers and return the results. See its syntax, examples, and output.

4 examples

Out-Host

Out

Use Out-Host to send output to the host for display, optionally one screen at a time. Review syntax and sample output, then try an example in the browser lab.

4 examples

Remove-Module

Remove

Unload a PowerShell module from the current session. Compare Remove-Module with uninstalling, check loaded modules and understand binary reload limits.

3 examples

Remove-Variable

Remove

Use Remove-Variable to delete a variable and its value from the session; -Force also clears read-only variables. See its syntax, examples, and output.

3 examples

Save-Module

Save

Use Save-Module to download a module and its dependencies to a folder without installing it. See its syntax, examples, and output.

4 examples

Set-Location

Set

Use Set-Location to change the current working directory, on any drive a provider exposes. See its syntax, examples, and output.

4 examples

Set-Variable

Set

Use Set-Variable to create or change a variable, with control over its scope and options. See its syntax, examples, and output.

4 examples

Start-Transcript

Start

Use Start-Transcript to begin recording the session, both commands and their output, to a text file. See its syntax, examples, and output.

4 examples

Stop-Transcript

Stop

Use Stop-Transcript to end the current transcript and close the file. See Microsoft.PowerShell.Host module requirements and examples.

4 examples

Trace-Command

Trace

Use Trace-Command to trace PowerShell's internal operations while running an expression, showing how it resolved what you asked for.

4 examples

Write-Debug

Write

Use Write-Debug to write a developer-facing message to the debug stream, hidden unless -Debug is passed. See its syntax, examples, and output.

4 examples

Write-Error

Write

Use Write-Error to write a non-terminating error to the error stream without stopping execution. See its syntax, examples, and output.

4 examples

Write-Information

Write

Use Write-Information to write a tagged message to the information stream, which can be captured separately from output.

4 examples

Write-Output

Write

Use Write-Output to send objects to the success stream, which is the stream the pipeline carries and a caller can capture.

3 examples

Write-Verbose

Write

Use Write-Verbose to write a diagnostic message that stays hidden unless the caller asks for it with -Verbose. See its syntax, examples, and output.

4 examples

Write-Warning

Write

Use Write-Warning to write a message to the warning stream, shown by default but kept out of your data. See its syntax, examples, and output.

4 examples

Read-Host

Other

Use Read-Host to ask the user a question and read the answer, or read a password securely.

3 examples

Write-Host

Other

Use Write-Host to write coloured messages to the console for status updates and warnings.

3 examples

Write-Progress

Other

Use Write-Progress to show a progress bar with percentage and time remaining for long tasks.

3 examples

Start-Sleep

Other

Use Start-Sleep to pause a script for seconds or milliseconds between retries and steps.

3 examples

Group Policy 5 commands

Read Group Policy objects, reports, and links.

Invoke-GPUpdate

Other

Use Invoke-GPUpdate to force a Group Policy refresh on a local or remote computer.

3 examples

Scheduled tasks 6 commands

Create and inspect scheduled tasks.

New-ScheduledTaskTrigger

New

Use New-ScheduledTaskTrigger to define when a scheduled task runs: daily, weekly, at logon, or at startup.

3 examples
Genie guidePowerShell command reference

Find command syntax, examples and expected output. Browser labs evaluate supported commands against fictional data; other examples are for inspection.