PowerShell Cmdlets
Filter by Set
...see more

Writes the specified objects to the pipeline. If Write-Output is the last command in the pipeline, the objects are displayed in the console.

     [-InputObject] <PSObject[]>

Write-Output sends objects to the primary pipeline, also known as the "output stream" or the "success pipeline." To send error objects to the error pipeline, use Write-Error.

This cmdlet is typically used in scripts to display strings and other objects on the console. One of the built-in aliases for Write-Output is echo and similar to other shells that use echo. The default behavior is to display the output at the end of a pipeline.


Write-Output "Warning: setting not available"
Write-Output "Error message" >> $logfile
Write-Output "$Message" | Tee-Object $logFile -Append

Additional Resources

...see more

Saves command output in a file or variable and also sends it down the pipeline.

   [-InputObject <PSObject>]
   [-FilePath] <String>
   [[-Encoding] <Encoding>]

The Tee-Object cmdlet redirects output, that is, it sends the output of a command in two directions (like the letter T). It stores the output in a file or variable and also sends it down the pipeline. If Tee-Object is the last command in the pipeline, the command output is displayed at the prompt.


Write-Output "$Message" | Tee-Object $logFile -Append
...see more

The PowerShell redirection operators are as follows, where n represents the stream number. The Success stream ( 1 ) is the default if no stream is specified.

  • > Send specified stream to a file. n>
  • >> Append specified stream to a file. n>>
  • >&1 Redirects the specified stream to the Success stream. n>&1

This example sends all Success stream data to a file called script.log.

.\script.ps1 > script.log

This example sends all streams output from a script called script.ps1 to a file called script.log

.\script.ps1 *> script.log

Source: about Redirection - PowerShell | Microsoft Docs

...see more

Writes customized output to a host.

     [[-Object] <Object>]
     [-Separator <Object>]
     [-ForegroundColor <ConsoleColor>]
     [-BackgroundColor <ConsoleColor>]

The Write-Host cmdlet's primary purpose is to produce for-(host)-display-only output, such as printing colored text like when prompting the user for input in conjunction with Read-Host. Write-Host uses the ToString() method to write the output. By contrast, to output data to the pipeline, use Write-Output or implicit output.

Write-Host "no newline test " -NoNewline
Write-Host "second string"

no newline test second string

Further information can be found at Write-Host (Microsoft.PowerShell.Utility) - PowerShell | Microsoft Docs.

...see more

The Copy-Item cmdlet copies an item from one location to another location in the same namespace. For instance, it can copy a file to a folder, but it can't copy a file to a certificate drive.

Copy a file to the specified directory

This example copies the mar1604.log.txt file to the C:\Presentation directory. The original file isn't deleted.

Copy-Item "C:\Wabash\Logfiles\mar1604.log.txt" -Destination "C:\Presentation"

Copy directory contents to an existing directory

This example copies the contents of the C:\Logfiles directory into the existing C:\Drawings directory. The Logfiles directory isn't copied.

If the Logfiles directory contains files in subdirectories, those subdirectories are copied with their file trees intact. By default, the Container parameter is set to True, which preserves the directory structure.

Copy-Item -Path "C:\Logfiles\*" -Destination "C:\Drawings" -Recurse

Further information and samples can be found at Copy-Item (Microsoft.PowerShell.Management) - PowerShell | Microsoft Docs

...see more

Selects objects or object properties.

The Select-Object cmdlet selects specified properties of an object or set of objects. It can also select unique objects, a specified number of objects, or objects in a specified position in an array.

To select objects from a collection, use the FirstLastUniqueSkip, and Index parameters. To select object properties, use the Property parameter. When you select properties, Select-Object returns new objects that have only the specified properties.

Example 1: Select objects by property

This example creates objects that have the Name, ID, and working set (WS) properties of process objects.

Get-Process | Select-Object -Property ProcessName, Id, WS

Select-Object (Microsoft.PowerShell.Utility) - PowerShell | Microsoft Docs

...see more

Module: Microsoft.PowerShell.Utility

Creates table-like custom objects from the items in a comma-separated value (CSV) file.

      [[-Delimiter] <Char>]
      [-Path] <String[]>
      [-Header <String[]>]
      [-Encoding <Encoding>]

The Import-Csv cmdlet creates table-like custom objects from the items in CSV files. Each column in the CSV file becomes a property of the custom object and the items in rows become the property values. Import-Csv works on any CSV file, including files that are generated by the Export-Csv cmdlet.

Import-Csv (Microsoft.PowerShell.Utility) - PowerShell | Microsoft Docs

...see more

Module: Microsoft.PowerShell.Core

Performs an operation against each item in a collection of input objects.

            [-InputObject <PSObject>]
            [-Begin <ScriptBlock>]
            [-Process] <ScriptBlock[]>
            [-End <ScriptBlock>]
            [-RemainingScripts <ScriptBlock[]>]

The ForEach-Object cmdlet performs an operation on each item in a collection of input objects. The input objects can be piped to the cmdlet or specified by using the InputObject parameter.

Starting in Windows PowerShell 3.0, there are two different ways to construct a ForEach-Object command.

...see more

Module: Microsoft.PowerShell.Utility

Converts object properties in comma-separated value (CSV) format into CSV versions of the original objects.

                [[-Delimiter] <Char>]
                [-InputObject] <PSObject[]>
                [-Header <String[]>]

The ConvertFrom-Csv cmdlet creates objects from CSV variable-length strings that are generated by the ConvertTo-Csv cmdlet.

ConvertFrom-Csv (Microsoft.PowerShell.Utility) - PowerShell | Microsoft Docs

...see more

Selects objects from a collection based on their property values.

     [-InputObject <PSObject>]
     [-Property] <String>
     [[-Value] <Object>]

The Where-Object cmdlet selects objects that have particular property values from the collection of objects that are passed to it. For example, you can use the Where-Object cmdlet to select files that were created after a certain date, events with a particular ID, or computers that use a particular version of Windows.

Example 1: Get stopped services

Get-Service | Where-Object {$_.Status -eq "Stopped"}
Get-Service | where Status -eq "Stopped"

Where-Object (Microsoft.PowerShell.Core) - PowerShell | Microsoft Docs

...see more

Module: Az.ConnectedMachine

Retrieves information about the model view or the instance view of a hybrid machine.

   [-SubscriptionId <String[]>]
   [-DefaultProfile <PSObject>]

Retrieves information about the model view or the instance view of a hybrid machine.

Example 1: List all connected machines in a subscription

Get-AzConnectedMachine -SubscriptionId 67379433-5e19-4702-b39a-c0a03ca8d20c

Name           Location OSName   Status     ProvisioningState
----           -------- ------   ------     -----------------
winwestus2_1   westus2  windows  Connected  Succeeded
linwestus2_1   westus2  linux    Connected  Succeeded
winwestus2_2   westus2  windows  Connected  Succeeded
winwestus2_3   westus2  windows  Connected  Succeeded

Get-AzConnectedMachine (Az.ConnectedMachine) | Microsoft Docs

...see more

Gets preferences for the Windows Defender scans and updates.

  [-CimSession <CimSession[]>]
  [-ThrottleLimit <Int32>]

The Get-MpPreference cmdlet gets preferences for the Windows Defender scans and updates. For more information about the preferences that this cmdlet retrieves, see Windows Defender Preferences Class.

Example to view the scheduled scan day

  • The first command gets the preferences and then stores them in the $Preferences variable.
  • The second command uses standard dot syntax to display the ScanScheduleDay property of the object stored in the $Preferences variable.
$Preferences = Get-MpPreference

Details about the preferences for Windows Defender scans and updates can be found in Set-MpPreference PowerShell Cmdlet.

For additional details visit Get-MpPreference (Defender) | Microsoft Docs.

...see more

Module: Defender

Configures preferences for Windows Defender scans and updates.

The Set-MpPreference cmdlet configures preferences for Windows Defender scans and updates. You can modify exclusion filename extensions, paths, or processes, and specify the default action for high, moderate, and low threat levels.


Example to schedule to check for definition updates everyday.

This command configures preferences to check for definition updates every day.

Set-MpPreference -SignatureScheduleDay Everyday

Additional examples at Schedule antivirus scans using PowerShell | Microsoft Docs

Details about the cmdlet at Set-MpPreference (Defender) | Microsoft Docs

Add to Set
  • .NET
  • .NET 6.0 Migration
  • 5 Best websites to read books online free with no downloads
  • 5 surprising things that men find unattractive
  • 5 Ways To Take Control of Overthinking
  • 6 simple methods for a more productive workday
  • 6 Ways To Stop Stressing About Things You Can't Control
  • Add React to ASP.NET Core
  • Adding reCAPTCHA to a .NET Core Web Site
  • Admin Accounts
  • Adobe Acrobat
  • Afraid of the new job? 7 positive tips against negative feelings
  • Agile
  • AI
  • AKS and Kubernetes Commands (kubectl)
  • API Lifecycle Management
  • Application Insights
  • arc42
  • Architectures
  • Article Writing Tools
  • ASP.NET Core Code Snippets
  • ASP.NET Core Performance Best Practices
  • ASP.NET Core Razor Pages
  • ASP.NET: Razor Syntax Cheat Sheet
  • Atlassian
  • Azure
  • Azure API Management
  • Azure App Registration
  • Azure Application Gateway
  • Azure Arc
  • Azure Arc Commands
  • Azure Architectures
  • Azure Bastion
  • Azure Bicep
  • Azure CLI Commands
  • Azure Cloud Products
  • Azure Cognitive Services
  • Azure Container Apps
  • Azure Cosmos DB
  • Azure Cosmos DB Commands
  • Azure Costs
  • Azure Daily
  • Azure Daily 2022
  • Azure Daily 2023
  • Azure Data Factory
  • Azure Database for MySQL
  • Azure Database for PostgreSQL
  • Azure Databricks
  • Azure Diagram Samples
  • Azure Durable Functions
  • Azure Firewall
  • Azure Functions
  • Azure Kubernetes Service (AKS)
  • Azure Landing Zone
  • Azure Log Analytics
  • Azure Logic Apps
  • Azure Maps
  • Azure Monitor
  • Azure News
  • Azure PowerShell Cmdlets
  • Azure PowerShell Login
  • Azure Private Link
  • Azure Purview
  • Azure Redis Cache
  • Azure Security Groups
  • Azure Sentinel
  • Azure Service Bus
  • Azure Service Bus Questions (FAQ)
  • Azure Services Abstract
  • Azure SQL
  • Azure Storage Account
  • Azure Tips and Tricks
  • Backlog Items
  • BASH Programming
  • Best LinkedIn Tips (Demo Test)
  • Best Practices for RESTful API
  • Bing Maps
  • Birthday Gift Ideas for Wife
  • Birthday Poems
  • Black Backgrounds and Wallpapers
  • Bootstrap Templates
  • Brave New World
  • Break Out of a JavaScript Loop
  • Brian Tracy Quotes
  • Build Websites Resources
  • C# Code Samples
  • C# Design Patterns
  • C# Development Issues
  • C# Programming Guide
  • Caching
  • Caching Patterns
  • Camping Trip Checklist
  • Canary Deployment
  • Careers of the Future You Should Know About
  • Cheap Vacation Ideas
  • Cloud Computing
  • Cloud Migration Methods
  • Cloud Native Applications
  • Cloud Service Models
  • Cloudflare
  • Code Snippets
  • Collection in JavaScript
  • Compelling Reasons Why Money Can’t Buy Happiness
  • Conditional Access
  • Configurations for Application Insights
  • Const in JavaScript
  • Create a Routine
  • Create sitemap.xml in ASP.NET Core
  • Creative Writing: Exercises for creative texts
  • CSS Selectors Cheat Sheet
  • Cultivate a Growth Mindset
  • Cultivate a Growth Mindset by Stealing From Silicon Valley
  • Custom Script Extension for Windows
  • Daily Scrum (Meeting)
  • Dalai Lama Quotes
  • Data Generators
  • DataGridView
  • Decision Trees
  • Deployments in Azure
  • Dev Box
  • Develop ASP.NET Core with React
  • Development Flows
  • Docker
  • Don’t End a Meeting Without Doing These 3 Things
  • Drink More Water: This is How it Works
  • Dropdown Filter
  • Earl Nightingale Quotes
  • Easy Steps Towards Energy Efficiency
  • EF Core
  • Elon Musk
  • Elon Musk Companies
  • Employment
  • English
  • Entity Framework Core: Syntax and Commands
  • Escape Double Quotes in C#
  • Escaping characters in C#
  • Executing Raw SQL Queries using Entity Framework Core
  • Factors to Consider While Selecting the Best Earthmoving System
  • Feng Shui 101: How to Harmonize Your Home in the New Year
  • Flying Machines
  • Foods against cravings
  • Foods that cool you from the inside
  • Four Misconceptions About Drinking
  • Fox News
  • Free APIs
  • Funny Life Quotes
  • Generate Faces
  • Generate Random Numbers in C#
  • Genius Money Hacks for Massive Savings
  • Git
  • Git Cheat Sheet
  • Git for Beginners
  • Git Fork
  • GitHub
  • GitHub Concepts
  • Green Careers Set to Grow in the Next Decade
  • Habits Of Highly Stressed People and how to avoid them
  • Happy Birthday Wishes & Quotes
  • Helm Overview
  • How to Clean Floors – Tips & Tricks
  • How to invest during the 2021 pandemic
  • How To Make Money From Real Estate
  • How To Stop Drinking Coffee
  • HTTP Status Code
  • Image for Websites
  • Inspirational Quotes
  • Iqra Technology, IT Services provider Company
  • JavaScript
  • JavaScript Scope
  • JavaScript Snippets
  • JavaScript Var, Let, and Const
  • Jobs Of 2050
  • jQuery
  • jQuery plugins
  • JSON (JavaScript Object Notation)
  • JSON for Linking Data (JSON-LD)
  • Json to C# Converters
  • JSON Tree Viewer JavaScript Plugin
  • JSX (ReactJS)
  • Karen Lamb Quotes
  • Kubernetes Objects
  • Kubernetes Tools
  • Kusto Query Language
  • Lack of time at work? 5 simple tricks to help you avoid stress
  • Lambda (C#)
  • Last Minute Travel Tips
  • Last-Minute-Reisetipps
  • Latest Robotics
  • Leadership
  • Let in JavaScript
  • List Of Hobbies And Interests
  • Logitech BRIO Webcam
  • Management
  • Mark Twain Quotes
  • Markdown
  • Meet Sophia
  • Message-Oriented Architecture
  • Microservices
  • Microsoft Authenticator App
  • Microsoft Power Automate
  • Microsoft SQL Server
  • Microsoft Teams
  • Mobile UI Frameworks
  • Motivation
  • Multilingual Applications
  • NBC News
  • NuGet
  • OAuth Authentication Flows
  • Objectives and Key Results (OKR)
  • Objectives and Key Results (OKR) Samples
  • OKR Software
  • Online JSON Viewer and Parser
  • Outlook Automation
  • PCMag
  • Phases of any relationship
  • Playwright
  • Popular cars per decade
  • Popular Quotes
  • PowerShell
  • PowerShell Array Guide
  • PowerShell Cmdlets
  • PowerShell Coding Samples
  • PowerToys
  • Prism
  • Pros & Cons Of Alternative Energy
  • Quill Rich Text Editor
  • Quotes
  • RACI Matrix
  • Razor Syntax
  • Reasons why singletasking is better than multitasking
  • Regular Expression (RegEx)
  • Reorder List in JavaScript
  • Resize Images in C#
  • Response Caching in ASP.NET Core
  • RESTful APIs
  • Rich Text Editors
  • Rob Siltanen Quotes
  • Robots
  • Run sudo commands
  • Salesforce Offshore Support Services Providers
  • Sample Data
  • Save Money On Food
  • Score with authenticity in the job interview
  • Scrum
  • Scrum Meetings
  • Security
  • Semantic Versioning
  • Serialization using Thread Synchronization
  • Service Worker
  • Snipps
  • Speak and Presentation
  • SQL Functions
  • SQL References
  • SQL Server Full-Text Search
  • Successful
  • Surface Lineup 2021
  • Surface Lineup 2021 Videos
  • SVG Online Editors
  • Team Manifesto
  • Technologies
  • Technology Abbreviations
  • Technology Glossary
  • TechSpot
  • That is why you should drink cucumber water every day
  • The Cache Tag Helper in ASP.NET Core
  • The Verge
  • Theodore Roosevelt Quotes
  • These 7 things make you unattractive
  • Things Successful People Do That Others Don’t
  • Things to Consider for a Great Birthday Party
  • Things to Consider When Designing A Website
  • Thoughts
  • TinyMCE Image Options
  • TinyMCE Toolbar Options
  • Tips for a Joyful Life
  • Tips for fewer emails at work
  • Tips for Making Better Decisions
  • Tips for Managing the Stress of Working at Home
  • Tips for Writing that Great Blog Post
  • Tips On Giving Flowers As Gifts
  • Tips you will listen better
  • Top Fitness Tips
  • Top Healthy Tips
  • Top Money Tips
  • Top Ten Jobs
  • Track Authenticated Users in Application Insights
  • Unicode Characters
  • Var in JavaScript
  • Visual Studio 2022
  • Vital everyday work: tips for healthy work
  • Walking barefoot strengthens your immune system
  • Walt Disney Quotes
  • Ways for Kids to Make Money
  • Web Design Trends & Ideas
  • Web Icons
  • Web Scraping
  • Webhooks
  • Website Feature Development
  • What are my options for investing money?
  • What happens when you drink water in the morning
  • What Is Stressful About Working at Home
  • What To Eat For Lunch
  • Windows
  • Windows 11 Top Features You Should Know
  • Winston Churchill Quotes
  • XPath
  • You'll burn out your team with these 5 leadership mistakes
  • ZDNet