Windows PowerShell Help

Windows PowerShell Getting Started Guide

Introducing Windows PowerShell

Windows PowerShell Cmdlets

A New Scripting Language

Windows Commands and Utilities

Processing Objects

Object Pipelines

Interaction and Scripting

An Interactive Environment

Support for Scripting

Starting Windows PowerShell

Using Windows PowerShell

Getting Help: Get-Help

Using Cmdlets

Using Functions

Using Modules and Snap-Ins

How to Import a Module

Learning About Objects: Get-Member

Formatting Command Output

Using Aliases

Using Windows Programs

Managing Errors

Navigating Windows PowerShell

Navigating the File System

Navigating the Registry

Navigating the Certificate Store

Navigating Other Drives

About Windows PowerShell Drives

Drives and Providers

Customizing Windows PowerShell

Examining the Execution Policy

Windows PowerShell Profiles

Introducing Windows PowerShell ISE

Windows PowerShell User's Guide

Windows PowerShell Basics

About Windows PowerShell

Installing and Running Windows PowerShell

Understanding Important Windows PowerShell Concepts

Learning Windows PowerShell Names

Getting Summary Command Information

Getting Detailed Help Information

Using Familiar Command Names

Using Tab Expansion

Object Pipeline

Understanding the Windows PowerShell Pipeline

Viewing Object Structure (Get-Member)

Using Format Commands to Change Output View

Redirecting Data with Out-* Cmdlets

Windows PowerShell Navigation

Managing Current Location

Managing Windows PowerShell Drives

Working With Files, Folders and Registry Keys

Manipulating Items Directly

Working with Objects

Getting WMI Objects (Get-WmiObject)

Creating .NET and COM Objects (New-Object)

Using Static Classes and Methods

Removing Objects from the Pipeline (Where-Object)

Repeating a Task for Multiple Objects (ForEach-Object)

Selecting Parts of Objects (Select-Object)

Sorting Objects

Using Variables to Store Objects

Using Windows PowerShell for Administration

Managing Processes with Process Cmdlets

Managing Services

Collecting Information About Computers

Working with Software Installations

Changing Computer State

Working with Printers

Performing Networking Tasks

Working with Files and Folders

Working with Registry Keys

Working with Registry Entries

Running Remote Commands

Appendix 1 - Compatibility Aliases

Appendix 2 - Creating a Custom Windows PowerShell Shortcut

Windows PowerShell About Help Topics

about_Aliases

about_Arithmetic_Operators

about_Arrays

about_Assignment_Operators

about_Automatic_Variables

about_Break

about_Command_Precedence

about_Command_Syntax

about_Comment_Based_Help

about_CommonParameters

about_Comparison_Operators

about_Continue

about_Core_Commands

about_Data_Sections

about_Debuggers

about_Do

about_Environment_Variables

about_Escape_Characters

about_EventLogs

about_Execution_Policies

about_For

about_Foreach

about_Format.ps1xml

about_Functions

about_Functions_Advanced

about_Functions_Advanced_Methods

about_Functions_Advanced_Parameters

about_Functions_CmdletBindingAttribute

about_Hash_Tables

about_History

about_If

about_Jobs

about_Job_Details

about_Join

about_Language_Keywords

about_Line_Editing

about_Locations

about_Logical_Operators

about_Methods

about_Modules

about_Objects

about_Operators

about_Parameters

about_Parsing

about_Path_Syntax

about_Pipelines

about_Preference_Variables

about_Profiles

about_Prompts

about_Properties

about_Providers

about_PSSessions

about_PSSession_Details

about_PSSnapins

about_Quoting_Rules

about_Redirection

about_Ref

about_Regular_Expressions

about_Remote

about_Remote_FAQ

about_Remote_Jobs

about_Remote_Output

about_Remote_Requirements

about_Remote_Troubleshooting

about_Requires

about_Reserved_Words

about_Return

about_Scopes

about_Script_Blocks

about_Script_Internationalization

about_Scripts

about_Session_Configurations

about_Signing

about_Special_Characters

about_Split

about_Switch

about_Throw

about_Transactions

about_Trap

about_Try_Catch_Finally

about_Type_Operators

about_Types.ps1xml

about_Variables

about_While

about_Wildcards

about_Windows_PowerShell_2.0

about_Windows_PowerShell_ISE

about_WMI_Cmdlets

about_WS-Management_Cmdlets

Windows PowerShell Cmdlet Help Topics

Add-Computer

Add-Content

Add-History

Add-Member

Add-PSSnapin

Add-Type

Checkpoint-Computer

Clear-Content

Clear-EventLog

Clear-History

Clear-Item

Clear-ItemProperty

Clear-Variable

Compare-Object

Complete-Transaction

Connect-WSMan

ConvertFrom-CSV

ConvertFrom-SecureString

ConvertFrom-StringData

Convert-Path

ConvertTo-CSV

ConvertTo-Html

ConvertTo-SecureString

ConvertTo-XML

Copy-Item

Copy-ItemProperty

Debug-Process

Disable-ComputerRestore

Disable-PSBreakpoint

Disable-PSRemoting

Disable-PSSessionConfiguration

Disable-WSManCredSSP

Disconnect-WSMan

Enable-ComputerRestore

Enable-PSBreakpoint

Enable-PSRemoting

Enable-PSSessionConfiguration

Enable-WSManCredSSP

Enter-PSSession

Exit-PSSession

Export-Alias

Export-Clixml

Export-Console

Export-Counter

Export-CSV

Export-FormatData

Export-ModuleMember

Export-PSSession

ForEach-Object

Format-Custom

Format-List

Format-Table

Format-Wide

Get-Acl

Get-Alias

Get-AuthenticodeSignature

Get-ChildItem

Get-Command

Get-ComputerRestorePoint

Get-Content

Get-Counter

Get-Credential

Get-Culture

Get-Date

Get-Event

Get-EventLog

Get-EventSubscriber

Get-ExecutionPolicy

Get-FormatData

Get-Help

Get-History

Get-Host

Get-Hotfix

Get-Item

Get-ItemProperty

Get-Job

Get-Location

Get-Member

Get-Module

Get-PfxCertificate

Get-Process

Get-PSBreakpoint

Get-PSCallStack

Get-PSDrive

Get-PSProvider

Get-PSSession

Get-PSSessionConfiguration

Get-PSSnapin

Get-Random

Get-Service

Get-TraceSource

Get-Transaction

Get-UICulture

Get-Unique

Get-Variable

Get-WinEvent

Get-WmiObject

Get-WSManCredSSP

Get-WSManInstance

Group-Object

Import-Alias

Import-Clixml

Import-Counter

Import-CSV

Import-LocalizedData

Import-Module

Import-PSSession

Invoke-Command

Invoke-Expression

Invoke-History

Invoke-Item

Invoke-WmiMethod

Invoke-WSManAction

Join-Path

Limit-EventLog

Measure-Command

Measure-Object

Move-Item

Move-ItemProperty

New-Alias

New-Event

New-EventLog

New-Item

New-ItemProperty

New-Module

New-ModuleManifest

New-Object

New-PSDrive

New-PSSession

New-PSSessionOption

New-Service

New-TimeSpan

New-Variable

New-WebServiceProxy

New-WSManInstance

New-WSManSessionOption

Out-Default

Out-File

Out-GridView

Out-Host

Out-Null

Out-Printer

Out-String

Pop-Location

Push-Location

Read-Host

Receive-Job

Register-EngineEvent

Register-ObjectEvent

Register-PSSessionConfiguration

Register-WmiEvent

Remove-Computer

Remove-Event

Remove-EventLog

Remove-Item

Remove-ItemProperty

Remove-Job

Remove-Module

Remove-PSBreakpoint

Remove-PSDrive

Remove-PSSession

Remove-PSSnapin

Remove-Variable

Remove-WmiObject

Remove-WSManInstance

Rename-Item

Rename-ItemProperty

Reset-ComputerMachinePassword

Resolve-Path

Restart-Computer

Restart-Service

Restore-Computer

Resume-Service

Select-Object

Select-String

Select-Xml

Send-MailMessage

Set-Acl

Set-Alias

Set-AuthenticodeSignature

Set-Content

Set-Date

Set-ExecutionPolicy

Set-Item

Set-ItemProperty

Set-Location

Set-PSBreakpoint

Set-PSDebug

Set-PSSessionConfiguration

Set-Service

Set-StrictMode

Set-TraceSource

Set-Variable

Set-WmiInstance

Set-WSManInstance

Set-WSManQuickConfig

Show-Eventlog

Sort-Object

Split-Path

Start-Job

Start-Process

Start-Service

Start-Sleep

Start-Transaction

Start-Transcript

Stop-Computer

Stop-Job

Stop-Process

Stop-Service

Stop-Transcript

Suspend-Service

Tee-Object

Test-ComputerSecureChannel

Test-Connection

Test-ModuleManifest

Test-Path

Test-WSMan

Trace-Command

Undo-Transaction

Unregister-Event

Unregister-PSSessionConfiguration

Update-FormatData

Update-List

Update-TypeData

Use-Transaction

Wait-Event

Wait-Job

Wait-Process

Where-Object

Write-Debug

Write-Error

Write-EventLog

Write-Host

Write-Output

Write-Progress

Write-Verbose

Write-Warning

Windows PowerShell Provider Help Topics

Alias Provider

Certificate Provider

Environment Provider

FileSystem Provider

Function Provider

Registry Provider

Variable Provider

WS-Management Provider

Windows PowerShell Integrated Scripting Environment (ISE) Help

Exploring Windows PowerShell ISE

Using Windows PowerShell ISE

How to Use Tab Completion in the Script Pane and the Command Pane

How to Create a PowerShell Tab in Windows PowerShell ISE

How to Use the Command Pane

How to Enter and Run a Command in the Command Pane

How to Edit Text in the Command Pane

How to Add Required Parameters in the Parameter Prompt Dialog Box

How to Manage Results in the Output Pane

How to Write and Run Scripts in the Script Pane

How to Create and Run a Script

How to Edit Text in the Script Pane

How to Save a Script

How to Manage and Close Script Tabs

How to Debug Scripts in Windows PowerShell ISE

How to Set, Remove, Disable, Enable, and List Breakpoints

How to Start, Stop, and Continue Debugging

How to Step Over, Step Into, and Step Out While Debugging

How to Use Profiles in Windows PowerShell ISE

How to Create Profiles in Windows PowerShell ISE

Accessibility in Windows PowerShell ISE

Accessibility Information

How to Change the Size and Location of the Command Pane and Script Pane

Keyboard Shortcuts

The Windows PowerShell ISE Scripting Object Model

Purpose of the Windows PowerShell ISE Scripting Object Model

The ISE object hierarchy

Other Useful Scripting Objects

Windows PowerShell ISE Object Model Reference

The ISEEditor Object

The ISEFile Object

The ISEFileCollection Object

The ISEMenuItem Object

The ISEMenuItemCollection Object

The ISEOptions Object

The ObjectModelRoot Object

The PowerShellTab Object

The PowerShellTabCollection Object

PowerShell.exe Console Help

Copyright Notice

Windows PowerShell Help

Windows PowerShell Getting Started Guide

Windows PowerShell is a new Windows command-line shell designed especially for system administrators. The Windows PowerShell includes an interactive prompt and a scripting environment that can be used independently or in combination.

Unlike most shells, which accept and return text, Windows PowerShell is built on top of the .NET Framework common language runtime (CLR) and the .NET Framework, and accepts and returns .NET Framework objects. This fundamental change in the environment brings entirely new tools and methods to the management and configuration of Windows.

Windows PowerShell introduces the concept of a cmdlet (pronounced "command-let"), a simple, single-function command-line tool built into the shell. You can use each cmdlet separately, but their power is realized when you use these simple tools in combination to perform complex tasks. Windows PowerShell includes more than one hundred basic core cmdlets, and you can write your own cmdlets and share them with other users.

Like many shells, Windows PowerShell gives you access to the file system on the computer. In addition, Windows PowerShell providers enable you to access other data stores, such as the registry and the digital signature certificate stores, as easily as you access the file system.

This Getting Started guide provides an introduction to Windows PowerShell: the language, the cmdlets, the providers, and the use of objects.

Introducing Windows PowerShell

Most shells, including Cmd.exe and the SH, KSH, CSH, and BASH UNIX shells, operate by executing a command or utility in a new process, and presenting the results to the user as text. Over the years, many text processing utilities, such as sed, AWK, and PERL, have evolved to support this interaction.

These shells also have commands that are built into the shell and run in the shell process, such as the typeset command in KSH and the dir command in Cmd.exe. In most shells, because there are few built-in commands, many utilities have been created.

Windows PowerShell is very different.

- Windows PowerShell does not process text. Instead, it processes objects based on the .NET Framework platform.

- Windows PowerShell comes with a large set of built-in commands with a consistent interface.

- All shell commands use the same command parser, instead of different parsers for each tool. This makes it much easier to learn how to use each command.

Best of all, you don't have to give up the tools that you have become accustomed to using. You can still use the traditional Windows tools, such as Net, SC, and Reg.exe in Windows PowerShell.

This section includes the following topics:

- Windows PowerShell Cmdlets

- A New Scripting Language

- Windows Commands and Utilities

- Processing Objects

- Object Pipelines

Windows PowerShell Cmdlets

A cmdlet (pronounced "command-let") is a single-feature command that manipulates objects in Windows PowerShell. You can recognize cmdlets by their name format -- a verb and noun separated by a dash (-), such as Get-Help, Get-Process, and Start-Service.

In traditional shells, the commands are executable programs that range from the very simple (such as attrib.exe) to the very complex (such as netsh.exe).

In Windows PowerShell, most cmdlets are very simple, and they are designed to be used in combination with other cmdlets. For example, the "get" cmdlets only retrieve data, the "set" cmdlets only establish or change data, the "format" cmdlets only format data, and the "out" cmdlets only direct the output to a specified destination.

Each cmdlet has a help file that you can access by typing:

get-help <cmdlet-name> -detailed

The detailed view of the cmdlet help file includes a description of the cmdlet, the command syntax, descriptions of the parameters, and an example that demonstrate use of the cmdlet.

A New Scripting Language

Windows PowerShell uses its own language, rather than reusing existing languages, for the following reasons.

- Windows PowerShell needed a language for managing Microsoft .NET Framework objects.

- The language needed to provide a consistent environment for using cmdlets.

- The language needed to support complex tasks, without making simple tasks more complex.

- The language needed to be consistent with higher-level languages used in .NET Framework programming, such as C#.

Windows Commands and Utilities

You can run Windows command-line programs in Windows PowerShell, and you can start Windows programs that have a graphical user interface, such as Notepad and Calculator, at the Windows Powershell prompt. You can also capture the text that Windows programs generate and use that text in Windows PowerShell.

For example, the following commands use Windows, the IPConfig, Net, and Shutdown commands.

C:\PS> net localgroup administrators /add domain01\user01

The command completed successfully.

C:\PS> ipconfig

Windows IP Configuration

Ethernet adapter Local Area Connection:

Connection-specific DNS Suffix  . : domain.corp.fabricam.com

IP Address. . . . . . . . . . . . : 142.20.152.115

Subnet Mask . . . . . . . . . . . : 255.255.252.0

Default Gateway . . . . . . . . . : 172.30.180.1

C:\PS> shutdown -r

You can even use Windows PowerShell cmdlets, like Select-String, to manipulate the text that Windows programs return.

For example, the following command uses a pipeline operator to send the results of an IPConfig command to the Windows PowerShell Select-String cmdlet, which searches for text in strings. In this case, you use Select-String to find the pattern "255" in the IpConfig output.

C:\PS> ipconfig | select-string -pattern 255

Subnet Mask . . . . . . . . . . . : 255.255.252.0

When a Windows command or tool has parameters, such as the "-r" (restart) parameter of Shutdown, Windows PowerShell passes the parameters to the tool without interpreting them.

However, if the tool uses a Windows PowerShell reserved word, or uses a command format that is unfamiliar to Windows PowerShell, such as Nant's "-D:debug=false" parameter (Windows PowerShell interprets this as two parameters, "-D" and "debug=false"), enclose the parameters in quotations marks to indicate to Windows PowerShell that it should send the parameters to the tool without interpretation.

Processing Objects

Although you might not realize it at first, when you work in Windows PowerShell, you are working with .NET Framework objects. As you gain experience, the power of object processing becomes more evident, and you'll find yourself using the objects and even thinking in objects.

Technically, a .NET Framework object is an instance of a .NET Framework class that consists of data and the operations associated with that data. But you can think of an object as a data entity that has properties, which are like characteristics, and methods, which are actions that you can perform on the object.

For example, when you get a service in Windows PowerShell, you are really getting an object that represents the service. When you view information about a service, you are viewing the properties of its service object. And, when you start a service, that is, when you change the Status property of the service to "started," you are using a method of the service object.

All objects of the same type have the same properties and methods, but each instance of an object can have different values for the properties. For example, every service object has a Name and Status property. However, each service can have a different name and a different status.

When you're ready, it's easy to learn about the objects. To find out what type of object a cmdlet is getting, use a pipeline operator (|) to send the results of a "get" command to the Get-Member command. For example, the following command sends the objects retrieved by a Get-Service command to Get-Member.

get-service | get-member

Get-Member displays information about the service object, including the typename of the object and a list of its properties and methods.

TypeName: System.ServiceProcess.ServiceController

Name                      MemberType    Definition

----                      ----------    ----------

Name                      AliasProperty Name = ServiceName

add_Disposed              Method        System.Void add_Disposed(EventHandler value)

Close                     Method        System.Void Close()

Continue                  Method        System.Void Continue()

...

For information about the object class, copy and paste the typename, such as System.ServiceProcess.ServiceController, in MSDN. When you find the class, you can read the MSDN subtopics to learn about the properties and methods of objects based on that class, like the ones in Windows PowerShell.

To find the values of all of the properties of a particular object, use a pipeline operator (|) to send the results of a "get" command to a Format-List or Format-Table command. Use the Property parameter of the format cmdlets with a value of all (*). For example, to find all of the properties of the Schedule service on the system, type:

get-service schedule | format-list -property *

The following shows an example of the result.

Name                : Schedule

CanPauseAndContinue : True

CanShutdown         : True

CanStop             : True

DisplayName         : Task Scheduler

DependentServices   : {}

MachineName         : .

ServiceName         : Schedule

ServicesDependedOn  : {RpcSs}

ServiceHandle       : SafeServiceHandle

Status              : Running

ServiceType         : Win32ShareProcess

Site                :

Container           :

You don't need to understand anything about objects when you are first learning Windows PowerShell, but keep the concept in the back of your mind. You'll soon be able to use the objects to their best advantage.

Object Pipelines

One major advantage of using objects is that it makes it much easier to pipeline commands, that is, to pass the output of one command to another command as input. In a traditional command-line environment, you would have to manipulate text to convert output from one format to another and to remove titles and column headings.

Windows PowerShell provides a new architecture that is based on objects, rather than text. The cmdlet that receives an object can act directly on its properties and methods without any conversion or manipulation. Users can refer to properties and methods of the object by name, rather than calculating the position of the data in the output.

In the following example, the result of an IpConfig command is passed to a Findstr command. The pipeline operator (|) sends the result of the command on its left to the command on its right. In Windows PowerShell™, you don't need to manipulate strings or calculate data offsets.

PS> ipconfig | findstr "Address"

IP Address. . . . . . . . . . . . : 172.28.21.5

IP Address. . . . . . . . . . . . : 172.30.160.225

Interaction and Scripting

This section contains the following topics:

- An Interactive Environment

- Support for Scripting

An Interactive Environment

Like other shells, Windows PowerShell supports a complete interactive environment. When you type a command at the prompt, the command is processed and the output is displayed in the shell window. You can send the output of a command to a file or printer, or you can use the pipeline operator (|) to send the output to another command.

Support for Scripting

If you run particular commands or command sequences repeatedly, or if you develop a series of commands to perform a complex task, you will want to save your commands in a file and execute the command file, instead of typing commands at the prompt. A file of commands is called a script.

In addition to its interactive interface, Windows PowerShell fully supports scripting. In Windows PowerShell, script files have a .ps1 file name extension. To run a script, type the name of the script at the command prompt. The file name extension is optional.

For example:

c:\test\testscript.ps1

-or-

c:\test\testscript

You must specify the fully qualified path to the script file, even if the script is in the current directory. To indicate the current directory, type the directory name or use a dot (.) to represent the current directory. For example:

.\testscript.ps1

Although scripts are extremely useful -- even essential -- in some enterprises, they can be used to spread malicious code. As a result, the security policy in Windows PowerShell, called an execution policy, lets you determine whether scripts can run and whether they must include a digital signature. To eliminate an obvious risk, none of the execution policies in Windows PowerShell allow you to run a script by double-clicking its icon. For more information, type:

get-help about_execution_policies

Windows PowerShell also includes a very rich scripting language that allows you to create scripts from the simplest to the very complex. It supports language constructs for looping, conditions, flow-control, and variable assignment.

See Also

- about_Scripts

- about_Execution_Policies

Starting Windows PowerShell

You can start Windows PowerShell from the Start menu, from the Taskbar, from the Search or Run box, from a Command Prompt window, or even from another Windows PowerShell window.

And you can start multiple instances of Windows PowerShell (or Windows PowerShell ISE) on a single computer.

How to Start Windows PowerShell

How to Start Windows PowerShell ISE

How to Start Windows PowerShell with All Modules

How to Start Windows PowerShell with Administrator Privileges

How to Start Windows PowerShell with Other Options

Using Windows PowerShell

This section explains the basics of using Windows PowerShell. First, it describes the Get-Help cmdlet (pronounced "command-let"), which displays information about cmdlets and conceptual topics in Windows PowerShell. Then, it describes a few of the basic cmdlets, explains how to use cmdlet parameters, and shows how to format the output of the cmdlets to get the data required to create a useful display. Finally, it shows how to use aliases in Windows PowerShell, how to run traditional Windows applications in Windows PowerShell, and how to manage errors.

This section includes the following topics:

- Getting Help: Get-Help

- Using Cmdlets

- Learning About Objects: Get-Member

- Formatting Command Output

- Using Aliases

- Using Windows Programs

- Managing Errors

Getting Help: Get-Help

The Get-Help cmdlet is a useful tool for learning about Windows PowerShell. By reading the descriptions of the cmdlets, learning about the concepts, and exploring the language topics, you can learn how to use Windows PowerShell.

The first topic of interest might be the Help system itself. To display information about the Help system in Windows PowerShell, type:

get-help

Then, you might be interested in learning about a few of the basic cmdlets, such as Get-Help, Get-Command, Get-Process, Get-Service, and Get-Eventlog.

To display the simplest view of Help for a cmdlet, type "get-help" followed by the cmdlet name. For example, to get Help for the Get-Command cmdlet, type:

get-help get-command

If the cmdlet Help is not formatted correctly, that is, if it begins with XMLNS tags, the Windows PowerShell execution policy on your system might have prevented the system from loading the configuration file that formats cmdlet Help. For more information about execution policies, type:

get-help about_execution_policies

To display detailed Help for a cmdlet, including parameter descriptions and examples, use the Detailed parameter of Get-Help. For example, to get detailed Help for the Get-Command cmdlet, type:

get-help get-command -detailed

To display all of the available Help for a cmdlet, including technical information about the cmdlet and its parameters, use the Full parameter. For example, to get complete Help for the Get-Command cmdlet, type:

get-help get-command -full

You can also display selected parts of the Help file. To see only the examples, use the Examples parameter. For example, to display the examples for the Get-Command cmdlet, type:

get-help get-command -examples

To see only detailed parameter descriptions, use the Parameter parameter of Get-Help. You can specify the name of a parameter or use the wildcard character (*) to specify all parameters. For example, to see a description of the TotalCount parameter of Get-Command, type:

get-help get-command -parameter totalcount

To see all parameters of the Get-Command cmdlet, type:

get-help get-command -parameter *

Windows PowerShell Help is also available online in the Microsoft TechNet library under the topic. The online version of the Help is often more easy to read and it is more frequently updated than the Help that is displayed at the command prompt.

In Windows PowerShell v.2, you can use the Online parameter of the Get-Help cmdlet to display the online version of a cmdlet Help topic. By default, the Online parameter links to the TechNet Library Help topics.

For example, to open the online version of the Help topic for the Get-Process cmdlet, type:

get-help get-process -online

You can also use one of the Windows PowerShell functions that call Get-Help. The Help function displays one screen of Help at a time. The Man function displays Help that looks like Man pages in UNIX. To use the Help and Man functions to display Help for the Get-Command cmdlet, type:

man get-command

or

help get-command

When you request a particular Help topic, Get-Help displays the content of the topic, but when you use wildcard characters to request more than one topic, Get-Help displays a list of topics. For example, to see a list of Help topics for the "Get" cmdlets, type:

get-help get-*

The Help topics that explain concepts in Windows PowerShell begin with "about_". To display Help about a Windows PowerShell concept, type "get-help" followed by the concept name. (The concept name must be entered in English, even in non-English versions of Windows PowerShell.)

For example, to get Help about wildcards, type:

get-help about_wildcards

To display a list of all of the conceptual Help topics in Windows PowerShell, type:

get-help about_*

By reading the Help topics and trying the examples, you will learn how to use Windows PowerShell.

See Also

- Get-Help

- Get-Command

Using Cmdlets

A cmdlet is a simple, single-function command-line tool built into the shell. You use cmdlets just as you would use traditional commands and utilities. Begin by typing the name of the cmdlet at the Windows PowerShell command prompt. Windows PowerShell commands are not case-sensitive, so you can type in any case.

For example, you can try the Get-Date cmdlet:

C:\PS> get-date

Thursday, November 10, 2005 4:43:50 PM

To list the cmdlets in your session, use the Get-Command cmdlet without any command parameters.

PS> get-command

CommandType     Name                            Definition

-----------     ----                            ----------

Cmdlet          Add-Content                     Add-Content [-Path] <String[...

Cmdlet          Add-History                     Add-History [[-InputObject] ...

Cmdlet          Add-Member                      Add-Member [-MemberType] <PS...

...

…

The default Get-Command display has three columns: CommandType, Name, and Definition. When listing cmdlets, the Definition column displays the syntax of the cmdlet. The ellipsis (…) in the syntax indicates that the data is truncated.

The Get-Command cmdlet also gets commands and command elements other than cmdlets, including aliases (command nicknames), functions, and executable files that are available in Windows PowerShell.

The following command lists the executable files available in Windows PowerShell by using the Name parameter of Get-Command.

PS> get-command -name *.exe

CommandType Name                   Definition

----------- ----                   ----------

Application 000StTHK.exe           C:\WINDOWS\system32\000StTHK.exe

Application 00THotkey.exe          C:\WINDOWS\system32\00THotkey.exe

Application accwiz.exe             C:\WINDOWS\system32\accwiz.exe

...

When listing executable files, the Definition column contains the full path to the executable file.

Then, try some of the other cmdlets, like Get-Process, Get-Service, Get-EventLog, and Get-Alias.

When you feel comfortable with the simple "Get-" cmdlets, try Get-WmiObject. This cmdlet enables you to view and change the components of remote computers. For example, the following command gets information about the BIOS on the Server01 remote computer:

get-wmiobject win32_bios -computername server01

If you need help with any cmdlet, type:

get-help <cmdlet-name> -detailed

for example:

get-help get-alias -detailed

Using Functions

In addition to running cmdlets, you can also run functions in Windows PowerShell. Windows PowerShell comes with built-in functions, and you can add functions that you get from other users and write your own functions.

About Functions

Finding Functions

Running Functions

Getting Help for Functions

Writing Functions

Saving Functions

See Also

Using Cmdlet Parameters
- about_Functions

- about_Functions_Advanced

- about_Command_Syntax

- about_Comment_Based_Help

- about_Profiles

- Using Cmdlets

Using Modules and Snap-Ins

Windows PowerShell is a fully extensible environment. Anyone can write commands for Windows PowerShell. You can use commands that others write and share the commands that you write with others.

Commands are shared by using modules and snap-ins. Windows PowerShell modules and snap-ins are packages that contain Windows PowerShell commands and other items. All cmdlets and providers in Windows PowerShell are delivered in snap-ins or modules, and modules can also contain functions, aliases, variables, and drives.

Some snap-ins and modules are added automatically to every Windows PowerShell session. If you receive a snap-in or module, you can install it and add the commands to your Windows PowerShell sessions. To share the commands that you write, you can create a Windows PowerShell module or snap-in.

About Modules

About Snap-ins

How to Import a Module

Modules are packages of Windows PowerShell commands, such as cmdlets and functions, and items, such as providers, variables, aliases and drives. If you have downloaded, installed, or received a module, use the procedure that is described in this topic to import or add it to your Windows PowerShell session.

Before Importing: Install the Module

How to Import a Module

See Also

- about_Modules

- Import-Module

Learning About Objects: Get-Member

One of the most useful cmdlets is Get-Member, which displays information about the .NET Framework object that a command returns. The information includes the type, properties, and methods of the object.

To use Get-Member, use a pipeline operator (|) to send the results of a command to Get-Member. For example:

get-service | get-member

This command reveals that Get-Service actually returns a set of System.ServiceProcess.ServiceController objects -- one for each service on the computer.

TypeName: System.ServiceProcess.ServiceController

Name                      MemberType    Definition

----                      ----------    ----------

Name                      AliasProperty Name = ServiceName

add_Disposed              Method        System.Void add_Disposed(EventHandler value)

Close                     Method        System.Void Close()

Continue                  Method        System.Void Continue()

CreateObjRef              Method        System.Runtime.Remoting.ObjRef CreateObjRef(Type requestedType)

Dispose                   Method        System.Void Dispose()

Equals                    Method        System.Boolean Equals(Object obj)

ExecuteCommand            Method        System.Void ExecuteCommand(Int32 command)

get_CanPauseAndContinue   Method        System.Boolean get_CanPauseAndContinue()

get_CanShutdown           Method        System.Boolean get_CanShutdown()

get_CanStop               Method        System.Boolean get_CanStop()

get_Container             Method        System.ComponentModel.IContainer get_Container()

get_DependentServices     Method        System.ServiceProcess.ServiceController[] get_DependentServices()

get_DisplayName           Method        System.String get_DisplayName()

get_MachineName           Method        System.String get_MachineName()

get_ServiceHandle         Method        System.Runtime.InteropServices.SafeHandle get_ServiceHandle()

get_ServiceName           Method        System.String get_ServiceName()

get_ServicesDependedOn    Method        System.ServiceProcess.ServiceController[] get_ServicesDependedOn()

get_ServiceType           Method        System.ServiceProcess.ServiceType get_ServiceType()

get_Site                  Method        System.ComponentModel.ISite get_Site()

get_Status                Method        System.ServiceProcess.ServiceControllerStatus get_Status()

GetHashCode               Method        System.Int32 GetHashCode()

GetLifetimeService        Method        System.Object GetLifetimeService()

GetType                   Method        System.Type GetType()

InitializeLifetimeService Method        System.Object InitializeLifetimeService()

Pause                     Method        System.Void Pause()

Refresh                   Method        System.Void Refresh()

remove_Disposed           Method        System.Void remove_Disposed(EventHandler value)

set_DisplayName           Method        System.Void set_DisplayName(String value)

set_MachineName           Method        System.Void set_MachineName(String value)

set_ServiceName           Method        System.Void set_ServiceName(String value)

set_Site                  Method        System.Void set_Site(ISite value)

Start                     Method        System.Void Start(), System.Void Start(String[] args)

Stop                      Method        System.Void Stop()

ToString                  Method        System.String ToString()

WaitForStatus             Method        System.Void WaitForStatus(ServiceControllerStatus desiredStatus), System.Voi...

CanPauseAndContinue       Property      System.Boolean CanPauseAndContinue {get;}

CanShutdown               Property      System.Boolean CanShutdown {get;}

CanStop                   Property      System.Boolean CanStop {get;}

Container                 Property      System.ComponentModel.IContainer Container {get;}

DependentServices         Property      System.ServiceProcess.ServiceController[] DependentServices {get;}

DisplayName               Property      System.String DisplayName {get;set;}

MachineName               Property      System.String MachineName {get;set;}

ServiceHandle             Property      System.Runtime.InteropServices.SafeHandle ServiceHandle {get;}

ServiceName               Property      System.String ServiceName {get;set;}

ServicesDependedOn        Property      System.ServiceProcess.ServiceController[] ServicesDependedOn {get;}

ServiceType               Property      System.ServiceProcess.ServiceType ServiceType {get;}

Site                      Property      System.ComponentModel.ISite Site {get;set;}

Status                    Property      System.ServiceProcess.ServiceControllerStatus Status {get;}

This information looks very technical, but it is actually very practical.

- The typename (such as "System.ServiceProcess.ServiceController") tells you what type of .NET object the cmdlet returns. For information about objects in this .NET class, paste the typename in the Search text box in MSDN. The associated MSDN topic includes information about the properties and methods of objects in this class, including the objects that Get-Service returns.

- The Property types represent properties of the objects. The value of each property is information about the service object. For example, the ServiceController objects have a CanPauseAndContinue property. The MSDN description of the property explains that the property tells whether the service can be paused and resumed.

To list the value of a property of a particular service, type:

(get-service <service-name>).<property-name>
such as:

(get-service alerter).canpauseandcontinue
To display a list with the name and the value of the CanPauseAndContinue property of the Alerter service, type:

get-service alerter | format-list -property name, CanPauseAndContinue
To display a list of the values of all properties of the Alerter service, type:

get-service alerter | format-list -property *
To display a table with the name and the value of the CanPauseAndContinue property of all services, type:

get-service | format-table -property name, CanPauseAndContinue

- The Method types represent methods of the object, that is, actions that you can perform on the object. For example, ServiceController objects have a Stop method that lets you stop the service.

To call a method of a service object, use the following format. (Be sure to include the parentheses).

(get-service <service-name>).<method-name>()

For example,

(get-service schedule).stop()

For more information about the Get-Member command, type:

get-help get-member -detailed

Formatting Command Output

In traditional shells, each tool or command determines the format of its output. Some tools let you customize the output, and they include special parameters to control the output format.

In Windows PowerShell, the only cmdlets that format output are the format cmdlets:

- Format-List

- Format-Custom

- Format-Table

- Format-Wide

None of the other cmdlets format output. As a result, you don't need to learn the formatting routines and parameters of multiple tools. Just learn about the Format cmdlets and their parameters.

When you run a command, the Windows PowerShell calls the default formatter, which is determined by the type of data being displayed. The formatter determines which properties of the output are displayed and whether they are displayed in a list or table.

For example, when you use the Get-Service cmdlet, the default display is a three-column table, such as the following:

C:\PS> get-service

Status   Name               DisplayName

------   ----               -----------

Running  AdtAgent           Event Forwarder

Stopped  Alerter            Alerter

Running  ALG                Application Layer Gateway Service

To change the format of the output from any cmdlet, use the pipeline operator (|) to send the output of the command to a Format cmdlet.

For example, the following command sends the output of a Get-Service command to the Format-List cmdlet. As a result, the service data is formatted as a list for each service.

C:\PS> get-service | format-list

Name                : AdtAgent

DisplayName         : Event Forwarder

Status              : Running

DependentServices   : {}

ServicesDependedOn  : {eventlog, dnscache}

CanPauseAndContinue : False

CanShutdown         : True

CanStop             : True

ServiceType         : Win32OwnProcess

Name                : Alerter

DisplayName         : Alerter

Status              : Stopped

DependentServices   : {}

ServicesDependedOn  : {LanmanWorkstation}

CanPauseAndContinue : False

CanShutdown         : False

CanStop             : False

ServiceType         : Win32ShareProcess

Name                : ALG

DisplayName         : Application Layer Gateway Service

Status              : Running

DependentServices   : {}

In this format, not only does the data appear in a list, instead of a table, but there is more information about each service. Instead of three columns of data for each service, there are nine rows of data. Format-List did not retrieve the extra service information. The data was always there in the objects that Get-Service retrieved, but Format-Table, the default formatter, omitted it, because it could not display more than three columns across on the screen.

In addition to determining whether the data appears in a list or table, you can also determine which properties of the object are displayed. For example, the default display of Get-Service display only the Status, Name, and DisplayName properties of the service object.

To see all of the properties of an object, use a pipeline operator (|) to send the output of a command to the Get-Member cmdlet. For example, to see all of the properties of a service object, type:

get-service | get-member -membertype *property

TypeName: System.ServiceProcess.ServiceController

Name                MemberType    Definition

----                ----------    ----------

Name                AliasProperty Name = ServiceName

CanPauseAndContinue Property      System.Boolean CanPauseAndContinue {get;}

CanShutdown         Property      System.Boolean CanShutdown {get;}

CanStop             Property      System.Boolean CanStop {get;}

Container           Property      System.ComponentModel.IContainer Container {get;}

DependentServices   Property      System.ServiceProcess.ServiceController[] DependentServices {get;}

DisplayName         Property      System.String DisplayName {get;set;}

MachineName         Property      System.String MachineName {get;set;}

ServiceHandle       Property      System.Runtime.InteropServices.SafeHandle ServiceHandle {get;}

ServiceName         Property      System.String ServiceName {get;set;}

ServicesDependedOn  Property      System.ServiceProcess.ServiceController[] ServicesDependedOn {get;}

ServiceType         Property      System.ServiceProcess.ServiceType ServiceType {get;}

Site                Property      System.ComponentModel.ISite Site {get;set;}

Status              Property      System.ServiceProcess.ServiceControllerStatus Status {get;}

Because all of these properties are in the object that Get-Service retrieves for each service, you can display any or all of them. Use the Property parameter of the Format cmdlets to select the properties to be displayed and the order in which they are displayed. For example, the following command uses the Format-Table command to display only the Name, ServiceType, and CanShutDown properties of the service.

get-service | format-table name, Servicetype, Canshutdown

This is just the beginning of what you can do with Windows PowerShell displays. For more details, use the following commands to read the help for the Format cmdlets:

get-help format-list

get-help format-table

get-help format-wide

get-help format-custom

Using Aliases

Cmdlet names can be cumbersome to type. To minimize typing, and to make it easier for users accustomed to other shells to use Windows PowerShell, Windows PowerShell supports the concept of an alias, that is, an alternate name for a command. You can create an alias for a cmdlet name, function name, or the name of an executable file, and then type the alias instead of the name in any command.

Windows PowerShell includes many built-in aliases and you can create your own. The aliases that you create are valid only within the current session. To create a persistent alias, add the alias to your Windows PowerShell profile.

To find all of the aliases in your session, type:

get-alias

To find the aliases for a cmdlet, type:

get-alias | where-object {$_.definition -eq "<cmdlet-name>"}

For example:

get-alias | where-object {$_.definition -eq "set-location"}

The aliases in Windows PowerShell are supported by the Windows PowerShell Alias provider, a .NET Framework assembly that lets you view the aliases in a drive that looks much like the file system drives in Windows. The drive for aliases is Alias:.

To change to the Alias drive, type:

set-location alias:

To view the aliases, that is, the child items in the Alias: drive, type

get-childitem

To view the child items in the Alias: drive from another drive, include the drive name in the command. For example:

get-childitem alias:

Creating an Alias

Deleting an Alias

Using Functions to Create Alternate Names

Using Windows Programs

You can run Windows command-line programs and start Windows graphic programs in Windows PowerShell. If the program generates text output, you can capture the text and use it in the new shell, just as you would in any shell.

To run a program, such as Notepad, in Windows PowerShell, the executable file for the program must be located in a directory that is included in the Path environment variable, because the value of the Path environment variable determines where Windows PowerShell looks for applications, utilities, and scripts. (Cmdlets do not have to be in a Path directory.)

To see the paths in the Path environment variable, type:

PS> $env:path

To add directories to the Path environment variable, type:

PS> $env:path += ";newdirectory"

For example, to add the directory of the WordPad.exe file to the Path variable, type:

PS> $env:path += ";C:\Program Files\Windows NT\Accessories"

Like the set command, this assignment statement only changes the value of Path for the current Windows PowerShell session. To make the change permanent, add the assignment statement to your Windows PowerShell profile. For details, see the "Windows PowerShell Profiles" topic.

Managing Errors

Errors will occur occasionally when you use the Windows PowerShell, such as when you are trying to set your location to a nonexistent directory or trying to remove a file without the required privileges.

In Windows PowerShell, there are two types of errors:

- Terminating errors: Errors that halt the execution of the command.

- Non-terminating errors: Errors that do not halt the execution of the command.

For example, if you are removing all of the .TMP files from a directory, you might not want the operation to stop if one of the files cannot be removed. Typically, you want to remove all of the files that you can remove, and then go back for the files that you could not remove.

The error that occurs when you cannot remove a file is called a non-terminating error. When a non-terminating error occurs, Windows PowerShell continues despite the error and then displays the error along with the output.

More serious errors will stop command processing. These are called terminating errors. Terminating errors stop the processing of the command. For example, if you submit data that is not valid or if you do not have the permissions required to perform the command, Windows PowerShell generates a terminating error.

Navigating Windows PowerShell

One of the most powerful features of Windows PowerShell™ is that it lets you navigate through many different data stores by using the same familiar techniques that you use to navigate in the file system.

In addition to the familiar file system drives, such as C: and D:, Windows PowerShell includes drives that represent the HKEY_LOCAL_MACHINE (HKLM:) and HKEY_CURRENT_USER (HKCU:) registry hives, the digital signature certificate store on your computer (Cert:), and the functions in the current session (Function:), among others. These are known as Windows PowerShell drives.

Windows PowerShell™ comes with several useful drives which are supported by Windows PowerShell providers. To see a list of Windows PowerShell drives, type:

get-psdrive

This section contains the following topics:

- Navigating the File System

- Navigating the Registry

- Navigating the Certificate Store

- Navigating Other Drives

- About Windows PowerShell Drives

- Drives and Providers

Navigating the File System

When you start Windows PowerShell™, you might be tempted to type the familiar cd, dir or ls. Do it! cd is an alias for the Set-Location cmdlet, the cmdlet that changes the current location to the specified path. dir and ls are aliases for the Get-Childitem cmdlet, the cmdlet that gets the child items in a location.

To navigate within the file system drive, use the Set-Location (cd) and Get-Childitem (dir, ls) cmdlets. In Windows PowerShell, drives are indicated by the drive name followed by a colon (:), such as C:, and parent items are separated from child item by backslashes (\) or forward slashes (/), such as C:\Windows\System32.

There are a few features that make it easier to navigate in Windows PowerShell:

- There are symbols for the current directory (.) and the contents of a directory (*).

- There are built-in variables for your home directory, $home, and the Windows PowerShell installation directory, $pshome.

As in other shells, you can change locations, create, delete, move, and copy directories and files, and change their properties. You can even use tab-completion for path names. For details, see Help for the Item cmdlets (Get-Item, Get-Childitem, New-Item, Remove-Item, Set-Item, Move-Item, and Copy-Item).

Navigating the Registry

You can navigate through the Windows registry by using the same techniques that you use to navigate in the file system drive. In Windows PowerShell, the HKEY_LOCAL_MACHINE hive maps to the Windows PowerShell HKLM: drive and the HKEY_CURRENT_USER hive maps to the Windows PowerShell HKCU: drive.

For example:

PS C:\> cd hklm:

PS HKLM:\> dir

PS HKLM:\> dir

Hive: Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE

SKC  VC Name                           Property

---  -- ----                           --------

4   0 HARDWARE                       {}

1   0 SAM                            {}

Get-ChildItem : Requested registry access is not allowed.

At line:1 char:3

+ dir <<<<

39   2 SOFTWARE                       {flash, (default)}

8   0 SYSTEM                         {}

PS HKLM:\> cd system\currentcontrolset\control

PS HKLM:\system\currentcontrolset\control> dir

As you navigate, you will notice that the output of dir (Get-Childitem) is different in the registry drives than it is in the file system. Because the registry has different drives, Windows PowerShell displays a different view of the data. In this case, it is important to know how many subkeys and entries are present, so the output includes a subkey count (SKC) and a value entry count (VC), in addition to the names of the subkeys and the entries.

PS> cd "CurrentControlSet\Control\Session Manager"

PS> dir

Hive: Registry::HKEY_LOCAL_MACHINE\system\CurrentControlSet\Control\Session

Manager

SKC  VC ChildName                      Property

---  -- ---------                      --------

0   1 AppCompatibility               {AppCompatCache}

15   0 AppPatches                     {}

0   7 DOS Devices                    {AUX, MAILSLOT, NUL, PIPE, PRN, UNC, f...

You won't encounter very many differences in navigation until you get to the registry entries. The entries in a registry key are considered to be properties of the key in which they are located. As such, you use the Get-ItemProperty cmdlet to retrieve them.

For example, if you want to see the value of the Windows PowerShell execution policy, you can use the Get-ExecutionPolicy cmdlet or navigate to the ExecutionPolicy registry entry that stores the value in HKLM:\Software\Microsoft\PowerShell\1\ShellIds\Microsoft.PowerShell.

PS C:\> cd hklm:

PS HKLM:\> cd software\microsoft\powershell\1\ShellIds\Microsoft.PowerShell

PS HKLM:\software\microsoft\powershell\1\ShellIds\Microsoft.PowerShell> dir

PS HKLM:\software\microsoft\powershell\1\ShellIds\Microsoft.PowerShell> get-itemproperty -path . -name executionpolicy

PSPath          : Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\software\microsoft\powershell\1\ShellIds\Micro

soft.PowerShell

PSParentPath    : Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\software\microsoft\powershell\1\ShellIds

PSChildName     : Microsoft.PowerShell

PSDrive         : HKLM

PSProvider      : Microsoft.PowerShell.Core\Registry

ExecutionPolicy : RemoteSigned

Navigating the Certificate Store

You can navigate in the digital signature certificate store on your computer. The certificate store maps to the Windows PowerShell Cert: drive. The following example shows how to use Set-Location (cd) and Get-Childitem (dir, ls) to navigate the Cert: drive.

PS C:\> cd cert:

PS cert:\> dir

Location   : CurrentUser

StoreNames : {TrustedPeople, _NMSTR, Trust, REQUEST...}

Location   : LocalMachine

StoreNames : {_NMSTR, Trust, REQUEST, TrustedPeople...}

PS cert:\> cd currentuser

PS cert:\currentuser> dir

Name : TrustedPeople

Name : _NMSTR

Name : Trust

Name : REQUEST

Name : AuthRoot

Name : ACRS

Name : My

Name : addressbook

Name : Disallowed

Name : CA

Name : UserDS

Name : Root

Name : TrustedPublisher

PS cert:\currentuser> cd authroot

PS cert:\currentuser\authroot> dir

Directory: Microsoft.PowerShell.Security\Certificate::currentuser\authroot

Thumbprint                                Subject

----------                                -------

F88015D3F98479E1DA553D24FD42BA3F43886AEF  O=C&W HKT SecureNet CA SGC Root, C=hk

F44095C238AC73FC4F77BF8F98DF70F8F091BC52  CN=Class 3TS Primary CA, O=Certplus, C=FR

EF2DACCBEABB682D32CE4ABD6CB90025236C07BC  O="Colegio Nacional de Correduria Publica Mexicana, A.C.", CN="Autoridad C...

...

PS cert:\currentuser\authroot> get-childitem F88015D3F98479E1DA553D24FD42BA3F43886AEF

Directory: Microsoft.PowerShell.Security\Certificate::currentuser\authroot

Thumbprint                                Subject

----------                                -------

F88015D3F98479E1DA553D24FD42BA3F43886AEF  O=C&W HKT SecureNet CA SGC Root, C=hk

PS cert:\currentuser\authroot> get-childitem F88015D3F98479E1DA553D24FD42BA3F43886AEF | format-list -property *

PSPath             : Microsoft.PowerShell.Security\Certificate::currentuser\authroot\F88015D3F98479E1DA553D24FD42BA3F43

886AEF

PSParentPath       : Microsoft.PowerShell.Security\Certificate::currentuser\authroot

PSChildName        : F88015D3F98479E1DA553D24FD42BA3F43886AEF

PSDrive            : cert

PSProvider         : Microsoft.PowerShell.Security\Certificate

PSIsContainer      : False

Archived           : False

Extensions         : {}

FriendlyName       : CW HKT SecureNet CA SGC Root

IssuerName         : System.Security.Cryptography.X509Certificates.X500DistinguishedName

NotAfter           : 10/16/2009 2:59:00 AM

NotBefore          : 6/30/1999 3:00:00 AM

HasPrivateKey      : False

PrivateKey         :

PublicKey          : System.Security.Cryptography.X509Certificates.PublicKey

RawData            : {48, 130, 2, 235...}

SerialNumber       : 00

SubjectName        : System.Security.Cryptography.X509Certificates.X500DistinguishedName

SignatureAlgorithm : System.Security.Cryptography.Oid

Thumbprint         : F88015D3F98479E1DA553D24FD42BA3F43886AEF

Version            : 1

Handle             : 1577256

Issuer             : O=C&W HKT SecureNet CA SGC Root, C=hk

Subject            : O=C&W HKT SecureNet CA SGC Root, C=hk

Navigating Other Drives

In addition to the file system, registry, and certificate drives, Windows PowerShell comes several other useful drives, including the alias (Alias:), environment provider (Env:), function (Function:), and variable (Variable:) drives. You use the basic same techniques to navigate in these drives.

About Windows PowerShell Drives

The concept behind the expanded navigation features in Windows PowerShell is the Windows PowerShell drive.

Windows PowerShell drives can be created in any data store that is available in Windows PowerShell, and they can have any valid name, such as C: or "My Drive", followed by a colon (:). You can navigate in them by using that same methods that you would use in a file system drive. However, the Windows PowerShell drives are visible only in Windows PowerShell. You cannot see them or gain access to them in Windows Explorer or Cmd.exe.

Windows PowerShell comes with several useful drives which are supported by Windows PowerShell providers. To see a list of Windows PowerShell drives, type:

get-psdrive

You can also create your own Windows PowerShell drives by using the New-PsDrive cmdlet. For example, to create a new drive called "MyDocs:" that is rooted in your My Documents directory, type:

new-psdrive -name MyDocs -psprovider FileSystem -root "$home\My Documents"

You can now use the MyDocs: drive as you would any other drive. You can change your location to it, enumerate its contents, and change its properties.

Drives and Providers

The drives in Windows PowerShell are made available to your session by Windows PowerShell providers, which are .NET Framework assemblies that make the data in a specialized data store available in Windows PowerShell so that you can easily view and manage the data. For information about Windows PowerShell providers, type:

get-help about_providers

To see a list of Windows PowerShell providers, type:

get-psprovider

For a list of provider help files, type:

get-help -category provider

For information about a particular provider, type:

get-help <provider-name>

For example,

get-help registry

Customizing Windows PowerShell

This section describes a few of the ways that you can customize Windows PowerShell to best meet your needs.

This section contains the following topics:

- Examining the Execution Policy

- Windows PowerShell Profiles

Examining the Execution Policy

Scripting is a very powerful tool, but it can be misused for malicious purposes. To protect user data and the integrity of the operating system, Windows PowerShell includes several security features, among which is the execution policy.

The Windows PowerShell execution policy determines whether scripts are allowed to run and, if they can run, whether they must be digitally signed. It also determines whether configuration files can be loaded.

The default execution policy, Restricted, is the most secure of the execution policies. It does not permit any scripts to run, and it does not permit any configuration files, including a Windows PowerShell profile, to be loaded. You can still use Windows PowerShell interactively.

However, if you want to run scripts or load configuration files, you can change the execution policy on your system. For information and instructions, type:

get-help about_execution_policies

To find the execution policy on your system, type:

get-executionpolicy

To change the execution policy on your system, use the Set-ExecutionPolicy cmdlet. For example, to change the execution policy to RemoteSigned, type:

set-executionpolicy remotesigned

The Windows PowerShell execution policy is saved in the Windows registry and is retained even when you uninstall and reinstall Windows PowerShell.

See Also

- about_Execution_Policies

- about_Signing

- Get-ExecutionPolicy

- Set-ExecutionPolicy

Windows PowerShell Profiles

When you add aliases, functions, and variables, you are actually adding them only to the current Windows PowerShell session. If you exit the session or close Windows PowerShell, the changes are lost.

To retain these changes, you can create a Windows PowerShell profile and add the aliases, functions, and variables to the profiles. The profile is loaded every time that Windows PowerShell starts.

To load a profile, your Windows PowerShell execution policy must permit you to load configuration files. If it does not, the attempt to load the profile fails and Windows PowerShell displays an error message.

Understanding the Profiles

Creating a Profile

Introducing Windows PowerShell ISE

To start Windows PowerShell ISE

To get Help in Windows PowerShell ISE

Windows PowerShell User's Guide

Windows PowerShell is a command-line shell and scripting environment that brings the power of the .NET Framework to command-line users and script writers. It introduces a number of powerful new concepts that enables you to extend the knowledge you have gained and the scripts you have created within the Windows Command Prompt and Windows Script Host environments.

Audience

Windows PowerShell Basics

Graphical user interfaces use some basic concepts that are well known to most computer users. Users rely on the familiarity of those interfaces to accomplish tasks. Operating systems present users with a graphical representation of items that can be browsed, usually with drop-down menus for accessing specific functionality and context menus for accessing context-specific functionality.

A command-line interface (CLI), such as Windows PowerShell, must use a different approach to expose information, because it does not have menus or graphical systems to help the user. You need to know command names before you can use them. Although you can type complex commands that are equivalent to the features in a GUI environment, you must become familiar with commonly-used commands and command parameters.

Most CLIs do not have patterns that can help the user to learn the interface. Because CLIs were the first operating system shells, many command names and parameter names were selected arbitrarily. Terse command names were generally chosen over clear ones. Although help systems and command design standards are integrated into most CLIs, they have been generally designed for compatibility with the earliest commands, so the command set is still shaped by decisions made decades ago.

Windows PowerShell was designed to take advantage of a user's historic knowledge of CLIs. In this chapter, we will talk about some basic tools and concepts that you can use to learn Windows PowerShell quickly. They include:

- Using Get-Command

- Using Cmd.exe and UNIX commands

- Using External Commands

- Using Tab-Completion

- Using Get-Help

About Windows PowerShell

Windows PowerShell is designed to improve the command-line and scripting environment by eliminating long-standing problems and adding new features.

Discoverability

Consistency

Interactive and Scripting Environments

Object Orientation

Easy Transition to Scripting

Installing and Running Windows PowerShell

Installation Requirements

Installing Windows PowerShell

Running Windows PowerShell

Understanding Important Windows PowerShell Concepts

Learning Windows PowerShell Names

Getting Summary Command Information

Getting Detailed Help Information

Windows PowerShell includes detailed Help topics that explain Windows PowerShell concepts and the Windows PowerShell language. There are also Help topics for each cmdlet and provider and Help topics for many functions and scripts.

You can display these Help topics at the command prompt or view the most recently updated versions of these topics in the Microsoft TechNet Library. Many programs that host Windows PowerShell, such as Windows PowerShell Integrated Scripting Environment, provide additional Help features, such as context-sensitive Help and compiled Help file (.chm).

Getting Help for Cmdlets

Getting Conceptual Help

Getting Help About Providers

Getting Help About Scripts and Functions

Getting Help Online

See Also

- about_Functions

- about_Scripts

- about_Comment_Based_Help

- Get-Help

Using Familiar Command Names

Using Tab Expansion

Command-line shells often provide a way to complete the names of long files or commands automatically, speeding up command entry and providing hints. Windows PowerShell allows you to fill in file names and cmdlet names by pressing the Tab key.

Note:

Tab expansion is controlled by the internal function TabExpansion. Since this function can be modified or overridden, this discussion is a guide to the behavior of the default Windows PowerShell configuration.

To fill in a filename or path from the available choices automatically, type part of the name and press the Tab key. Windows PowerShell will automatically expand the name to the first match that it finds. Pressing the Tab key repeatedly will cycle through all of the available choices.

The tab expansion of cmdlet names is slightly different. To use tab expansion on a cmdlet name, type the entire first part of the name (the verb) and the hyphen that follows it. You can fill in more of the name for a partial match. For example, if you type get-co and then press the Tab key, Windows PowerShell will automatically expand this to the Get-Command cmdlet (notice that it also changes the case of letters to their standard form). If you press Tab key again, Windows PowerShell replaces this with the only other matching cmdlet name, Get-Content.

You can use tab expansion repeatedly on the same line. For example, you can use tab expansion on the name of the Get-Content cmdlet by entering:

PS> Get-Con<Tab>

When you press the Tab key, the command expands to:

PS> Get-Content

You can then partially specify the path to the Active Setup log file and use tab expansion again:

PS> Get-Content c:\windows\acts<Tab>

When you press the Tab key, the command expands to:

PS> Get-Content C:\windows\actsetup.log

Note:

One limitation of the tab expansion process is that tabs are always interpreted as attempts to complete a word. If you copy and paste command examples into a Windows PowerShell console, make sure that the sample does not contain tabs; if it does, the results will be unpredictable and will almost certainly not be what you intended.

Object Pipeline

Pipelines act like a series of connected segments of pipe. Items moving along the pipeline pass through each segment. To create a pipeline in Windows PowerShell, you connect commands together with the pipe operator "|". The output of each command is used as input to the next command.

Pipelines are arguably the most valuable concept used in command-line interfaces. Properly used, pipelines not only reduce the effort involved in entering complex commands, but also make it easier to see the flow of work in the commands. A related useful characteristic of pipelines is that because they operate on each item separately, you do not have to modify them based on whether you will have zero, one, or many items in the pipeline. Furthermore, each command in a pipeline (called a pipeline element) usually passes its output to the next command in the pipeline item-by-item. This usually reduces the resource demand of complex commands and allows you to begin getting the output immediately.

In this chapter, we will describe how the Windows PowerShell pipeline differs from the pipelines of most popular shells, and then demonstrate some basic tools that you can use to help control pipeline output and also to see how the pipeline operates.

Understanding the Windows PowerShell Pipeline

Viewing Object Structure (Get-Member)

Because objects play such a central role in Windows PowerShell, there are several native commands designed to work with arbitrary object types. The most important one is the Get-Member command.

The simplest technique for analyzing the objects that a command returns is to pipe the output of that command to the Get-Member cmdlet. The Get-Member cmdlet shows you the formal name of the object type and a complete listing of its members. The number of elements that are returned can sometimes be overwhelming. For example, a process object can have over 100 members.

To see all the members of a Process object and page the output so you can view all of it, type:

PS> Get-Process | Get-Member | Out-Host -Paging

The output from this command will look something like this:

TypeName: System.Diagnostics.Process

Name                           MemberType     Definition

----                           ----------     ----------

Handles                        AliasProperty  Handles = Handlecount

Name                           AliasProperty  Name = ProcessName

NPM                            AliasProperty  NPM = NonpagedSystemMemorySize

PM                             AliasProperty  PM = PagedMemorySize

VM                             AliasProperty  VM = VirtualMemorySize

WS                             AliasProperty  WS = WorkingSet

add_Disposed                   Method         System.Void add_Disposed(Event...

...

We can make this long list of information more usable by filtering for elements we want to see. The Get-Member command lets you list only members that are properties. There are several forms of properties. The cmdlet displays properties of any type if we set the Get-Member MemberType parameter to the value Properties. The resulting list is still very long, but a bit more manageable:

PS> Get-Process | Get-Member -MemberType Properties

TypeName: System.Diagnostics.Process

Name                       MemberType     Definition

----                       ----------     ----------

Handles                    AliasProperty  Handles = Handlecount

Name                       AliasProperty  Name = ProcessName

...

ExitCode                   Property       System.Int32 ExitCode {get;}

...

Handle                     Property       System.IntPtr Handle {get;}

...

CPU                        ScriptProperty System.Object CPU {get=$this.Total...

...

Path                       ScriptProperty System.Object Path {get=$this.Main...

...

Note:

The allowed values of MemberType are AliasProperty, CodeProperty, Property, NoteProperty, ScriptProperty, Properties, PropertySet, Method, CodeMethod, ScriptMethod, Methods, ParameterizedProperty, MemberSet, and All.

There are over 60 properties for a process. The reason Windows PowerShell often shows only a handful of properties for any well-known object is that showing all of them would produce an unmanageable amount of information.

Note:

Windows PowerShell determines how to display an object type by using information stored in XML files that have names ending in .format.ps1xml. The formatting data for process objects, which are .NET System.Diagnostics.Process objects, is stored in PowerShellCore.format.ps1xml.

If you need to look at properties other than those that Windows PowerShell displays by default, you will need to format the output data yourself. This can be done by using the format cmdlets.

Using Format Commands to Change Output View

Redirecting Data with Out-* Cmdlets

Windows PowerShell Navigation

Folders are a familiar organizational feature of the Windows Explorer interface, Cmd.exe, and UNIX tools such as BASH. Folders, or directories as they are more commonly known, are a useful concept for organizing files and other directories. UNIX-family operating systems extend this by treating everything possible as a file; specific hardware and network connections appear as files within particular folders. This approach does not ensure that the content is readable or usable by particular applications, but it does make it simpler to find specific items. Tools that enumerate or search through files and folders work with these devices as well. You can also address a specific item by using the path to the file that represents it.

Analogously, the Windows PowerShell infrastructure supports exposing virtually anything that can be navigated like a standard Microsoft Windows disk drive or a UNIX filesystem as a Windows PowerShell Drive. A Windows PowerShell Drive does not necessarily represent a real drive, either locally or on the network. This chapter primarily discusses navigation for file systems, but the concepts apply to Windows PowerShell Drives that are not associated with file systems.

Managing Current Location

Managing Windows PowerShell Drives

Working With Files, Folders and Registry Keys

Manipulating Items Directly

Working with Objects

We have discussed how Windows PowerShell uses objects to transfer data between cmdlets, and demonstrated a few ways to view detailed information about objects by using Get-Member and Format cmdlets to view particular properties of objects.

The power of objects is that they provide you with access to a lot of complex data, and it is already correlated. With some simple techniques you can further manipulate objects to do even more work. We are going to look at some specific types of objects and ways you can manipulate them in this chapter.

Getting WMI Objects (Get-WmiObject)

Getting WMI Objects (Get-WmiObject)

Creating .NET and COM Objects (New-Object)

Using Static Classes and Methods

Removing Objects from the Pipeline (Where-Object)

Repeating a Task for Multiple Objects (ForEach-Object)

Selecting Parts of Objects (Select-Object)

Sorting Objects

Using Variables to Store Objects

Using Windows PowerShell for Administration

The fundamental goal of Windows PowerShell is providing better, easier administrative control over systems, either interactively or from script. This chapter walks through solutions to many specific problems in administering Windows systems with Windows PowerShell. Although we have not talked about scripts or functions in the Windows PowerShell User's Guide, the solutions can be used from scripts or as functions later. We will show examples that include functions as part of the solution to solve problems.

Throughout the solution descriptions, you will see a mix of solutions using specific cmdlets, the general Get-WmiObject cmdlet, and even external tools that are part of the Windows and .NET Framework infrastructures. Use of external tools is part of the long-term design intent of Windows PowerShell. Even as the system grows, users will continually encounter situations in which the available toolsets do not do everything they need. Rather than foster dependency on cmdlet implementations alone, Windows PowerShell tries to support integrating solutions from every possible alternative scenario.

Managing Processes with Process Cmdlets

You can use the Process cmdlets in Windows PowerShell to manage local and remote processes in Windows PowerShell.

Getting Processes (Get-Process)

Stopping Processes (Stop-Process)

Stopping All Other Windows PowerShell Sessions

Starting, Debugging, and Waiting for Processes

See Also

- Get-Process

- Stop-Process

- Start-Process

- Wait-Process

- Debug-Process

- Invoke-Command

Managing Services

There are eight core Service cmdlets, designed for a wide range of service tasks . We will look only at listing and changing running state for services, but you can get a list Service cmdlets by using Get-Help *-Service, and you can find information about each Service cmdlet by using Get-Help <Cmdlet-Name>, such as Get-Help New-Service.

Getting Services

Getting Required and Dependent Services

Stopping, Starting, Suspending, and Restarting Services

Setting Service Properties

See Also

- Get-Service

- Set-Service

- Restart-Service

- Suspend-Service

Collecting Information About Computers

Working with Software Installations

Changing Computer State

Working with Printers

Performing Networking Tasks

Working with Files and Folders

Working with Registry Keys

Working with Registry Entries

Running Remote Commands

You can run commands on one or hundreds of computers with a single Windows PowerShell command. Windows PowerShell supports remote computing by using various technologies, including WMI, RPC, and WS-Management.

Remoting Without Configuration

Windows PowerShell Remoting

See Also

New-PSSessionConfiguration
- about_Remote

- about_Remote_FAQ

- about_Remote_Requirements

- about_Remote_Troubleshooting

- about_PSSessions

- about_WS-Management_Cmdlets

- Invoke-Command

- Import-PSSession

- New-PSSession

- WS-Management Provider

Appendix 1 - Compatibility Aliases

Windows PowerShell has several transition aliases that allow UNIX and Cmd users to use familiar command names in Windows PowerShell. The most common aliases are shown in the table below, along with the Windows PowerShell command behind the alias and the standard Windows PowerShell alias if one exists.

You can find the Windows PowerShell command that any alias points to from within Windows PowerShell by using the Get-Alias cmdlet. For example, type get-alias cls.

CommandType     Name                            Definition

-----------     ----                            ----------

Alias           cls                             Clear-Host

CMD Command

UNIX Command

PS Command

PS Alias

dir

ls

Get-ChildItem

gci

cls

clear

Clear-Host (function)

N/A

del, erase, rmdir

rm

Remove-Item

ri

copy

cp

Copy-Item

ci

move

mv

Move-Item

mi

rename

mv

Rename-Item

rni

type

cat

Get-Content

gc

cd

cd

Set-Location

sl

md

mkdir

New-Item

ni

N/A

pushd

Push-Location

N/A

N/A

popd

Pop-Location

N/A

Appendix 2 - Creating a Custom PowerShell Shortcut

Windows PowerShell About Help Topics

This section contains the conceptual ("about") help topics in Windows PowerShell.

Topic

Description

about_Aliases

Describes alternate names for cmdlets and commands in Windows PowerShell.

about_Arithmetic_Operators

Describes the operators that perform arithmetic in Windows PowerShell.

about_Arrays

Describes arrays; a compact data structure for storing data elements.

about_Assignment_Operators

Describes the operators that assign values to variables.

about_Automatic_Variables

Describes the automatic variables, which that store state information for Windows PowerShell.

about_Break

Explains how to use the   Break statement, a statement that immediately exits Foreach, For, While, Do, and Switch statements.

about_Command_Precedence

Explains how Windows PowerShell finds commands.

about_Command_Syntax

Explains the command format in Windows PowerShell.

about_Comment_Based_Help

Explains how to write comment-based help topics for functions and scripts.

about_CommonParameters

Describes parameters that can be used with any cmdlet.

about_Comparison_Operators

Describes the operators that compare values in Windows PowerShell.

about_Continue

Describes the   Continue statement, which immediately returns to top of a program loop.

about_Core_Commands

Lists the cmdlets designed for use with Windows PowerShell providers.

about_Data_Sections

Describes the   Data section of scripts, which is designed to isolate data from code logic.

about_Debuggers

Describes the Windows PowerShell script debugger, a set of cmdlets for debugging scripts and functions.

about_Do

Describes the Do statement, which runs a script block one or more times subject to a While or Until condition.

about_Environment_Variables

Explains how to access Windows environment variables in Windows PowerShell.

about_Escape_Characters

Introduces the escape character in Windows PowerShell (`) and explains its effect.

about_EventLogs

Describes the   Windows PowerShell event log in Event Viewer.

about_Execution_Policies

Describes the   Windows PowerShell execution policies and explains how to manage them.

about_For

Describes the   For loop in Windows PowerShell.

about_Foreach

Describes the   ForEach statement, a statement that acts on each item in a collection.

about_Format.ps1xml

Describes the Format.ps1xml files that define the default display of objects in the console.

about_Functions

Explains how to create and use functions in Windows PowerShell.

about_Functions_Advanced

Introduction to advanced functions; the functions that act like cmdlets.

about_Functions_Advanced_Methods

Explains how to use the methods and properties that are available to cmdlets in advanced functions.

about_Functions_Advanced_Parameters

Shows how to declare parameters for advanced functions.

about_Functions_CmdletBindingAttribute

Describes the   CmdletBinding attribute, which identifies a function that works like a cmdlet.

about_Hash_Tables

Explains how to create, use, and sort hash tables in Windows PowerShell.

about_History

Explains how to get and run commands from the command history.

about_If

Describes the   If statement, which establishes conditions for an action.

about_Jobs

Describes Windows PowerShell background jobs.

about_Job_Details

Provides detailed information about background jobs.

about_Join

Describes the   Join operator, which combines multiple strings into a single string.

about_Language_Keywords

Describes the keywords in the Windows PowerShell scripting language.

about_Line_Editing

Describes the editing features of the Windows PowerShell console.

about_Locations

Explains how to use the working location in Windows PowerShell.

about_Logical_Operators

Describes the operators that connect statements in Windows PowerShell.

about_Methods

Explains how to use methods to perform actions on objects in Windows PowerShell.

about_Modules

Explains how to install, import, and use Windows PowerShell modules.

about_Objects

Explains how to work with objects in Windows PowerShell.

about_Operators

The overview topic that describes operators in Windows PowerShell. Contains topics about each operator type.

about_Parameters

Explains how to working with cmdlet parameters in Windows PowerShell.

about_Parsing

Explains how Windows PowerShell parses commands.

about_Path_Syntax

Describes full and relative path name formats in Windows PowerShell.

about_Pipelines

Explains how to combine commands into pipelines in Windows PowerShell.

about_Preference_Variables

Describes the preference variables that customize Windows PowerShell.

about_Profiles

Explains how to create and use a Windows PowerShell profile.

about_Prompts

Explains how to create and use a Windows PowerShell profile.

about_Properties

Explains how to use object properties in Windows PowerShell.

about_Providers

Describes the Windows PowerShell providers and explains how to use the data that they expose.

about_PSSessions

Describes Windows PowerShell sessions (PSSessions) and explains how to use them to run remote commands.

about_PSSession_Details

Provides detailed information about Windows PowerShell sessions.

about_PSSnapins

Describes Windows PowerShell snap-ins and explains how to use them to extend Windows PowerShell.

about_Quoting_Rules

Explains the rules for using single and double quotation marks in Windows PowerShell, including here-strings.

about_Redirection

Explains how to redirect output to variables and text files. Includes redirection operators.

about_Ref

Explains how to create and use a reference variable type.

about_Regular_Expressions

Explains how to use regular expressions in Windows PowerShell.

about_Remote

How to run remote commands in Windows PowerShell.

about_Remote_FAQ

Questions and answers about running remote commands in Windows PowerShell.

about_Remote_Jobs

Explains how to run background jobs on remote computers

about_Remote_Output

Interpreting and formatting the output of remote commands.

about_Remote_Requirements

System requirements and configuration requirements for running remote commands in Windows PowerShell.

about_Remote_Troubleshooting

Troubleshooting remote operations in Windows PowerShell.

about_Requires

Describes the Requires statement, which prevents a script from running without required snap-ins and versions.

about_Reserved_Words

Lists words that are reserved to Windows PowerShell.

about_Return

Exits the current scope, which can be a function, script, or script block.

about_Scopes

Explains how to set and change the scope of functions and variables in Windows PowerShell.

about_Script_Blocks

Explains how to use script blocks to combine expressions, statements and commands into a single code block.

about_Script_Internationalization

Describes the features that make it easy for scripts to display user messages in the language selected for Windows.

about_Scripts

Explains how to write and run scripts in Windows PowerShell.

about_Session_Configurations

Describes session configurations, which determine the users who can connect to the computer remotely and the commands they can run.

about_Signing

Describes the Windows PowerShell execution policies, explains how to manage them, and explains to how sign scripts so they comply with the execution policies.

about_Special_Characters

Describes the special characters in Windows PowerShell.

about_Split

Describes the   Split operator, which splits strings into substrings.

about_Switch

Explains how to use a switch statement to replace multiple   If statements.

about_Throw

Describes the   Throw keyword, which generates a terminating error.

about_Transactions

Explains how to manage transacted operations in Windows PowerShell.

about_Trap

Describes the   Trap keyword, which handles a terminating error.

about_Try_Catch_Finally

Error handling in scripts is done using the Try, Catch, and Finally script blocks.

about_Types.ps1xml

Describes the Types.ps1xml files that let you extend the .NET types of objects used in Windows PowerShell.

about_Type_Operators

Describes the operators that work with .NET types.

about_Variables

An overview topic that explains the types of variables in Windows PowerShell.

about_While

Describes   While loops in Windows PowerShell.

about_Wildcards

Explains how to use the wildcard character (*) in Windows PowerShell.

about_Windows_PowerShell_2.0

Describes the features introduced in the Windows PowerShell 2.0.

about_Windows_PowerShell_ISE

Describes the Windows PowerShell Integrated Scripting Environment.

about_WMI_Cmdlets

Provides background information about Windows Management Instrumentation (WMI) and Windows PowerShell.

about_WS-Management_Cmdlets

Provides an overview of Web Services for Management (WS-Management) as background for using the WS-Management cmdlets in Windows PowerShell.

See Also

- Windows PowerShell Cmdlet Help Topics

- Windows PowerShell Provider Help Topics

- PowerShell.exe Console Help

about_Aliases

about_Arithmetic_Operators

about_Arrays

about_Assignment_Operators

about_Automatic_Variables

about_Break

about_Command_Precedence

about_Command_Syntax

about_Comment_Based_Help

about_CommonParameters

about_Comparison_Operators

about_Continue

about_Core_Commands

about_Data_Sections

about_Debuggers

about_Do

about_Environment_Variables

about_Escape_Characters

about_EventLogs

about_Execution_Policies

about_For

about_Foreach

about_Format.ps1xml

about_Functions

about_Functions_Advanced

about_Functions_Advanced_Methods

about_Functions_Advanced_Parameters

about_Functions_CmdletBindingAttribute

about_Hash_Tables

about_History

about_If

about_Jobs

about_Job_Details

about_Join

about_Language_Keywords

about_Line_Editing

about_Locations

about_Logical_Operators

about_Methods

about_Modules

about_Objects

about_Operators

about_Parameters

about_Parsing

about_Path_Syntax

about_Pipelines

about_Preference_Variables

about_Profiles

about_Prompts

about_Properties

about_Providers

about_PSSessions

about_PSSession_Details

about_PSSnapins

about_Quoting_Rules

about_Redirection

about_Ref

about_Regular_Expressions

about_Remote

about_Remote_FAQ

about_Remote_Jobs

about_Remote_Output

about_Remote_Requirements

about_Remote_Troubleshooting

about_Requires

about_Reserved_Words

about_Return

about_Scopes

about_Script_Blocks

about_Script_Internationalization

about_Scripts

about_Session_Configurations

about_Signing

about_Special_Characters

about_Split

about_Switch

about_Throw

about_Transactions

about_Trap

about_Try_Catch_Finally

about_Type_Operators

about_Types.ps1xml

about_Variables

about_While

about_Wildcards

about_Windows_PowerShell_2.0

about_Windows_PowerShell_ISE

about_WMI_Cmdlets

about_WS-Management_Cmdlets

Windows PowerShell Cmdlet Help Topics

This section contains the help topics for the cmdlets that are installed with Windows PowerShell.

Display in verb order

Display in noun order

Cmdlets (In Verb Order)

Cmdlets (In Noun Order)

See Also

- Windows PowerShell About Help Topics

- Windows PowerShell Provider Help Topics

- PowerShell.exe Console Help

Add-Computer

Add the local computer to a domain or workgroup.

Syntax

Description

Parameters

Inputs and Outputs

Example 1

Example 2

Example 3

Example 4

Example 5

See Also

- Checkpoint-Computer

- Remove-Computer

- Restart-Computer

- Restore-Computer

- Stop-Computer

- Test-Connection

Add-Content

Adds content to the specified items, such as adding words to a file.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

See Also

- about_Providers

- Get-Content

- Set-Content

- Clear-Content

- Get-Item

Add-History

Appends entries to the session history.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

Example 5

See Also

- about_History

- Get-History

- Invoke-History

- Clear-History

Add-Member

Adds a user-defined custom member to an instance of a Windows PowerShell object.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

Example 5

Example 6

See Also

- Get-Member

- Export-Clixml

- Import-Clixml

Add-PSSnapin

Adds one or more Windows PowerShell snap-ins to the current session.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

See Also

- Get-PSSnapin

- Remove-PSSnapin

- about_Profiles

Add-Type

Adds a Microsoft .NET Framework type (a class) to a Windows PowerShell session.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

Example 5

Example 6

Example 7

See Also

- Add-Member

- New-Object

Checkpoint-Computer

Creates a system restore point on the local computer.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

See Also

- Add-Computer

- Remove-Computer

- Restart-Computer

- Restore-Computer

- Stop-Computer

- Test-Connection

Clear-Content

Deletes the contents of an item, such as deleting the text from a file, but does not delete the item.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

See Also

- about_Providers

- Get-Content

- Set-Content

- Add-Content

- Get-Item

Clear-EventLog

Deletes all entries from specified event logs on the local or remote computers.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

See Also

- Get-EventLog

- Limit-EventLog

- New-EventLog

- Remove-EventLog

- Show-Eventlog

- Write-EventLog

- Get-WinEvent

Clear-History

Deletes entries from the command history.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

Example 5

See Also

- about_History

- Get-History

- Add-History

- Invoke-History

Clear-Item

Deletes the contents of an item, but does not delete the item.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

See Also

- about_Providers

- Copy-Item

- Get-Item

- Invoke-Item

- Move-Item

- Set-Item

- New-Item

- Remove-Item

- Rename-Item

Clear-ItemProperty

Deletes the value of a property but does not delete the property.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

See Also

- about_Providers

- Copy-ItemProperty

- New-ItemProperty

- Move-ItemProperty

- Rename-ItemProperty

- Get-ItemProperty

- New-ItemProperty

Clear-Variable

Deletes the value of a variable.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

See Also

- Get-Variable

- Set-Variable

- New-Variable

- Remove-Variable

Compare-Object

Compares two sets of objects.

Syntax

Description

Parameters

Inputs and Outputs

Example 1

Example 2

Example 3

See Also

- Group-Object

- Measure-Object

- Sort-Object

- ForEach-Object

- New-Object

- Select-Object

- Tee-Object

- Where-Object

Complete-Transaction

Commits the active transaction.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

See Also

- about_Transactions

- Start-Transaction

- Get-Transaction

- Undo-Transaction

- Use-Transaction

Connect-WSMan

Connects to the WinRM service on a remote computer.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

See Also

- Disable-WSManCredSSP

- Disconnect-WSMan

- Enable-WSManCredSSP

- Get-WSManCredSSP

- Get-WSManInstance

- Invoke-WSManAction

- New-WSManInstance

- New-WSManSessionOption

- Remove-WSManInstance

- Set-WSManInstance

- Set-WSManQuickConfig

- Test-WSMan

ConvertFrom-CSV

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

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

See Also

- ConvertTo-CSV

- Export-CSV

- Import-CSV

ConvertFrom-SecureString

Converts a secure string into an encrypted standard string.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

See Also

- ConvertTo-SecureString

- Read-Host

ConvertFrom-StringData

Converts a string containing one or more key/value pairs to a hash table.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

Example 5

Example 6

See Also

- about_Data_Sections

- about_Quoting_Rules

- about_Script_Internationalization

Convert-Path

Converts a path from a Windows PowerShell path to a Windows PowerShell provider path.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

See Also

- about_Providers

- Test-Path

- Split-Path

- Resolve-Path

- Join-Path

ConvertTo-CSV

Converts Microsoft .NET Framework objects into a series of comma-separated value (CSV) variable-length strings.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

See Also

- Import-CSV

- Export-CSV

- ConvertFrom-CSV

ConvertTo-Html

Converts Microsoft .NET Framework objects into HTML that can be displayed in a Web browser.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

Example 5

Example 6

Example 7

Example 8

Example 9

See Also

- ConvertTo-CSV

- ConvertTo-XML

ConvertTo-SecureString

Converts encrypted standard strings to secure strings. It can also convert plain text to secure strings. It is used with ConvertFrom-SecureString and Read-Host.

Syntax

Description

Parameters

Inputs and Outputs

Example 1

Example 2

Example 3

See Also

- ConvertFrom-SecureString

- Read-Host

ConvertTo-XML

Creates an XML-based representation of an object.

Syntax

Description

Parameters

Inputs and Outputs

Example 1

Example 2

See Also

- Export-Clixml

- Import-Clixml

- ConvertTo-Html

- ConvertTo-CSV

Copy-Item

Copies an item from one location to another within a namespace.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

See Also

- about_Providers

- Clear-Item

- Get-Item

- Invoke-Item

- Move-Item

- Set-Item

- New-Item

- Remove-Item

- Rename-Item

Copy-ItemProperty

Copies a property and value from a specified location to another location.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

See Also

- about_Providers

- Clear-ItemProperty

- New-ItemProperty

- Move-ItemProperty

- Rename-ItemProperty

- Get-ItemProperty

- Set-ItemProperty

Debug-Process

Debugs one or more processes running on the local computer.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

Example 5

Example 6

Example 7

Example 8

See Also

- Get-Process

- Start-Process

- Stop-Process

- Wait-Process

- Debug-Process

Disable-ComputerRestore

Disables the System Restore feature on the specified file system drive.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

See Also

- Enable-ComputerRestore

- Get-ComputerRestorePoint

- Restore-Computer

- Restart-Computer

Disable-PSBreakpoint

Disables the breakpoints in the current console.

Syntax

Description

Parameters

Inputs and Outputs

Example 1

Example 2

Example 3

Example 4

See Also

- about_Debuggers

- Set-PSBreakpoint

- Get-PSBreakpoint

- Enable-PSBreakpoint

- Remove-PSBreakpoint

- Get-PSCallStack

Disable-PSRemoting

Prevents the computer from receiving remote Windows PowerShell commands.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

See Also

- Enable-PSRemoting

- Disable-PSSessionConfiguration

- Get-PSSessionConfiguration

- Register-PSSessionConfiguration

- Set-PSSessionConfiguration

- Unregister-PSSessionConfiguration

- WS-Management Provider

Disable-PSSessionConfiguration

Denies access to the session configurations on the local computer.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

Example 5

See Also

- about_Session_Configurations

- Enable-PSSessionConfiguration

- Get-PSSessionConfiguration

- Register-PSSessionConfiguration

- Set-PSSessionConfiguration

- Unregister-PSSessionConfiguration

- WS-Management Provider

Disable-WSManCredSSP

Disables Credential Security Service Provider (CredSSP) authentication on a client computer.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

See Also

- Connect-WSMan

- Disconnect-WSMan

- Enable-WSManCredSSP

- Get-WSManCredSSP

- Get-WSManInstance

- Invoke-WSManAction

- New-WSManInstance

- New-WSManSessionOption

- Remove-WSManInstance

- Set-WSManInstance

- Set-WSManQuickConfig

- Test-WSMan

Disconnect-WSMan

Disconnects the client from the WinRM service on a remote computer.

Syntax

Description

Parameters

Inputs and Outputs

Example 1

See Also

- Connect-WSMan

- Disable-WSManCredSSP

- Enable-WSManCredSSP

- Get-WSManCredSSP

- Get-WSManInstance

- Invoke-WSManAction

- New-WSManInstance

- New-WSManSessionOption

- Remove-WSManInstance

- Set-WSManInstance

- Set-WSManQuickConfig

- Test-WSMan

Enable-ComputerRestore

Enables the System Restore feature on the specified file system drive.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

See Also

- Disable-ComputerRestore

- Get-ComputerRestorePoint

- Restore-Computer

- Restart-Computer

Enable-PSBreakpoint

Enables the breakpoints in the current console.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

See Also

- about_Debuggers

- Set-PSBreakpoint

- Disable-PSBreakpoint

- Get-PSBreakpoint

- Remove-PSBreakpoint

- Get-PSCallStack

Enable-PSRemoting

Configures the computer to receive remote commands.

Syntax

Description

Parameters

Inputs and Outputs

Example 1

Example 2

See Also

- about_Remote

- about_Session_Configurations

- Disable-PSRemoting

- Get-PSSessionConfiguration

- Enable-PSSessionConfiguration

- Disable-PSSessionConfiguration

- Register-PSSessionConfiguration

- Set-PSSessionConfiguration

- WS-Management Provider

Enable-PSSessionConfiguration

Enables the session configurations on the local computer.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

See Also

- about_Session_Configurations

- Disable-PSSessionConfiguration

- Get-PSSessionConfiguration

- Register-PSSessionConfiguration

- Set-PSSessionConfiguration

- Unregister-PSSessionConfiguration

- WS-Management Provider

Enable-WSManCredSSP

Enables Credential Security Service Provider (CredSSP) authentication on a client computer.

Syntax

Description

Parameters

Inputs and Outputs

Example 1

Example 2

Example 3

Example 4

Example 5

See Also

- Connect-WSMan

- Disable-WSManCredSSP

- Disconnect-WSMan

- Get-WSManCredSSP

- Get-WSManInstance

- Invoke-WSManAction

- New-WSManInstance

- New-WSManSessionOption

- Remove-WSManInstance

- Set-WSManInstance

- Set-WSManQuickConfig

- Test-WSMan

Enter-PSSession

Starts an interactive session with a remote computer.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

Example 5

See Also

- about_PSSessions

- about_Remote

- New-PSSession

- Get-PSSession

- Exit-PSSession

- Remove-PSSession

- Invoke-Command

Exit-PSSession

Ends an interactive session with a remote computer.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

See Also

- about_PSSessions

- about_Remote

- Enter-PSSession

- New-PSSession

- Get-PSSession

- Remove-PSSession

- Invoke-Command

Export-Alias

Exports information about currently defined aliases to a file.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

See Also

- Import-Alias

- Get-Alias

- New-Alias

- Set-Alias

Export-Clixml

Creates an XML-based representation of an object or objects and stores it in a file.

Syntax

Description

Parameters

Inputs and Outputs

Example 1

Example 2

See Also

- Import-Clixml

- ConvertTo-XML

- Export-CSV

- ConvertTo-Html

Export-Console

Exports the names of snap-ins in the current session to a console file.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

Example 5

See Also

- Add-PSSnapin

- Get-PSSnapin

- Remove-PSSnapin

Export-Counter

The Export-Counter cmdlet takes PerformanceCounterSampleSet objects and exports them as counter log files.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

See Also

- Get-Counter

- Import-Counter

Export-CSV

Converts Microsoft .NET Framework objects into a series of comma-separated value (CSV) variable-length strings and saves the strings in a CSV file.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

Example 5

See Also

- Import-CSV

- ConvertTo-CSV

- ConvertFrom-CSV

Export-FormatData

Saves formatting data from the current session in a formatting file.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

See Also

- Get-FormatData

- Update-FormatData

Export-ModuleMember

Specifies the module members that are exported.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

Example 5

Example 6

Example 7

See Also

- Import-Module

- Get-Module

- Remove-Module

- about_Modules

Export-PSSession

Imports commands from another session and saves them in a Windows PowerShell module.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

Example 5

See Also

- about_Command_Precedence

- Import-PSSession

- New-PSSession

- Import-Module

- Invoke-Command

- about_PSSessions

ForEach-Object

Performs an operation against each of a set of input objects.

Syntax

Description

Parameters

Inputs and Outputs

Example 1

Example 2

Example 3

Example 4

Format-Custom

Uses a customized view to format the output.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Format-List

Formats the output as a list of properties in which each property appears on a new line.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

Format-Table

Formats the output as a table.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

Example 5

Example 6

See Also

- Format-List

- Format-Wide

- Format-Custom

Format-Wide

Formats objects as a wide table that displays only one property of each object.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Get-Acl

Gets the security descriptor for a resource, such as a file or registry key.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

See Also

- Set-Acl

Get-Alias

Gets the aliases for the current session.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

Example 5

See Also

- about_Aliases

- Set-Alias

- New-Alias

- Export-Alias

- Import-Alias

- Alias Provider

Get-AuthenticodeSignature

Gets information about the Authenticode signature in a file.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

See Also

- about_Signing

- about_Execution_Policies

- Set-AuthenticodeSignature

- Get-ExecutionPolicy

- Set-ExecutionPolicy

Get-ChildItem

Gets the items and child items in one or more specified locations.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

Example 5

Example 6

Example 7

See Also

- about_Providers

- Get-Item

- Get-Alias

- Get-Location

- Get-Process

Get-Command

Gets basic information about cmdlets and other elements of Windows PowerShell commands.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

Example 5

Example 6

Example 7

Example 8

Example 9

Example 10

Example 11

See Also

- about_Command_Precedence

- Get-Help

- Get-PSDrive

- Get-Member

- Import-PSSession

- Export-PSSession

Get-ComputerRestorePoint

Gets the restore points on the local computer.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

Example 5

See Also

- Enable-ComputerRestore

- Disable-ComputerRestore

- Restore-Computer

- Restart-Computer

Get-Content

Gets the content of the item at the specified location.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

See Also

- about_Providers

- Add-Content

- Set-Content

- Clear-Content

Get-Counter

Gets performance counter data from local and remote computers.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

Example 5

Example 6

Example 7

Example 8

Example 9

Example 10

Example 11

Example 12

Example 13

Example 14

Example 15

See Also

- Import-Counter

- Export-Counter

Get-Credential

Gets a credential object based on a user name and password.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

Example 5

Example 6

Get-Culture

Gets the current culture set in the operating system.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Get-Date

Gets the current date and time.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

Example 5

Example 6

Example 7

Example 8

Example 9

See Also

- Set-Date

- New-TimeSpan

Get-Event

Gets the events in the event queue.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

See Also

- Register-ObjectEvent

- Register-EngineEvent

- Register-WmiEvent

- Unregister-Event

- New-Event

- Remove-Event

- Wait-Event

Get-EventLog

Gets the events in an event log, or a list of the event logs, on the local or remote computers.

Syntax

Description

Parameters

Inputs and Outputs

Example 1

Example 2

Example 3

Example 4

Example 5

Example 6

Example 7

Example 8

Example 9

Example 10

Example 11

See Also

- Get-WinEvent

- Clear-EventLog

- Limit-EventLog

- New-EventLog

- Remove-EventLog

- Show-Eventlog

- Write-EventLog

- Get-WinEvent

Get-EventSubscriber

Gets the event subscribers in the current session.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

See Also

- Register-ObjectEvent

- Register-EngineEvent

- Register-WmiEvent

- Unregister-Event

- Get-Event

- New-Event

- Remove-Event

- Wait-Event

Get-ExecutionPolicy

Gets the execution policies for the current session.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

See Also

- Set-ExecutionPolicy

- Get-AuthenticodeSignature

- Set-AuthenticodeSignature

- about_Execution_Policies

- about_Signing

Get-FormatData

Gets the formatting data in the current session.

Syntax

Description

Parameters

Inputs and Outputs

Example 1

Example 2

Example 3

Example 4

See Also

- Export-FormatData

- Update-FormatData

Get-Help

Displays information about Windows PowerShell commands and concepts.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

Example 5

Example 6

Example 7

Example 8

Example 9

Example 10

Example 11

Example 12

Example 13

Example 14

Example 15

See Also

- about_Comment_Based_Help

- Get-Command

- Get-PSDrive

- Get-Member

Get-History

Gets a list of the commands entered during the current session.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

Example 5

Example 6

See Also

- about_History

- Invoke-History

- Add-History

- Clear-History

Get-Host

Gets an object that represents the current host program. And, displays Windows PowerShell version and regional information by default.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

Example 5

Example 6

Example 7

Example 8

See Also

- Read-Host

- Out-Host

- Write-Host

Get-Hotfix

Gets the hotfixes that have been applied to the local and remote computers.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

See Also

- Get-ComputerRestorePoint

Get-Item

Gets the item at the specified location.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

Example 5

Example 6

Example 7

See Also

- about_Providers

- Clear-Item

- Copy-Item

- Invoke-Item

- Move-Item

- Set-Item

- New-Item

- Remove-Item

- Rename-Item

Get-ItemProperty

Gets the properties of a specified item.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

Example 5

Example 6

See Also

- about_Providers

- Set-ItemProperty

- Clear-ItemProperty

- Copy-ItemProperty

- Move-ItemProperty

- New-ItemProperty

- Remove-ItemProperty

- Rename-ItemProperty

Get-Job

Gets Windows PowerShell background jobs that are running in the current session.

Syntax

Description

Parameters

Inputs and Outputs

Example 1

Example 2

Example 3

Example 4

Example 5

Example 6

Example 7

Example 8

Example 9

See Also

- about_Jobs

- about_Job_Details

- about_Remote_Jobs

- Start-Job

- Receive-Job

- Wait-Job

- Stop-Job

- Remove-Job

- Invoke-Command

Get-Location

Gets information about the current working location.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

See Also

- about_Providers

- Pop-Location

- Push-Location

- Set-Location

Get-Member

Gets the properties and methods of objects.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

Example 5

Example 6

Example 7

See Also

- Add-Member

- Get-Help

- Get-Command

- Get-PSDrive

Get-Module

Gets the modules that have been imported or that can be imported into the current session.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

Example 5

Example 6

Example 7

Example 8

See Also

- Import-Module

- New-Module

- Remove-Module

- about_Modules

Get-PfxCertificate

Gets information about .pfx certificate files on the computer.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

See Also

- Get-AuthenticodeSignature

- Set-AuthenticodeSignature

- about_Signing

Get-Process

Gets the processes that are running on the local computer or a remote computer.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

Example 5

Example 6

Example 7

Example 8

Example 9

See Also

- Get-Process

- Start-Process

- Stop-Process

- Wait-Process

- Debug-Process

Get-PSBreakpoint

Gets the breakpoints that are set in the current session.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

Example 5

Example 6

Example 7

Example 8

See Also

- about_Debuggers

- Set-PSBreakpoint

- Disable-PSBreakpoint

- Enable-PSBreakpoint

- Remove-PSBreakpoint

- Get-PSCallStack

Get-PSCallStack

Displays the current call stack.

Syntax

Description

Parameters

Inputs and Outputs

Example 1

See Also

- about_Debuggers

- Set-PSBreakpoint

- Get-PSBreakpoint

- Enable-PSBreakpoint

- Disable-PSBreakpoint

- Remove-PSBreakpoint

Get-PSDrive

Gets the Windows PowerShell drives in the current session.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

Example 5

See Also

- about_Providers

- New-PSDrive

- Remove-PSDrive

- Get-Help

- Get-Command

- Get-Member

Get-PSProvider

Gets information about the specified Windows PowerShell provider.

Syntax

Description

Parameters

Inputs and Outputs

Example 1

Example 2

Example 3

See Also

- about_Providers

Get-PSSession

Gets the Windows PowerShell sessions (PSSessions) in the current session.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

Example 5

Example 6

Example 7

See Also

- about_PSSessions

- about_Remote

- New-PSSession

- Remove-PSSession

- Enter-PSSession

- Exit-PSSession

- Invoke-Command

Get-PSSessionConfiguration

Gets the registered session configurations on the computer.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

Example 5

Example 6

See Also

- about_Session_Configurations

- Disable-PSSessionConfiguration

- Enable-PSSessionConfiguration

- Register-PSSessionConfiguration

- Set-PSSessionConfiguration

- Unregister-PSSessionConfiguration

- WS-Management Provider

Get-PSSnapin

Gets the Windows PowerShell snap-ins on the computer.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

See Also

- Add-PSSnapin

- Remove-PSSnapin

Get-Random

Gets a random number, or selects objects randomly from a collection.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

Example 5

Example 6

Example 7

Example 8

Example 9

Example 10

Example 11

Example 12

Example 13

Get-Service

Gets the services on a local or remote computer.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

Example 5

Example 6

Example 7

Example 8

Example 9

Example 10

Example 11

See Also

- Start-Service

- Stop-Service

- Restart-Service

- Resume-Service

- Suspend-Service

- Set-Service

- New-Service

Get-TraceSource

Gets the Windows PowerShell components that are instrumented for tracing.

Syntax

Description

Parameters

Inputs and Outputs

Example 1

Example 2

See Also

- Set-TraceSource

- Trace-Command

Get-Transaction

Gets the current (active) transaction.

Syntax

Description

Parameters

Inputs and Outputs

Example 1

Example 2

Example 3

Example 4

Example 5

Example 6

See Also

- about_Transactions

- about_Providers

- Start-Transaction

- Complete-Transaction

- Undo-Transaction

- Use-Transaction

Get-UICulture

Gets the current user interface (UI) culture settings in the operating system.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

Get-Unique

Returns the unique items from a sorted list.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

See Also

- Select-Object

- Sort-Object

Get-Variable

Gets the variables in the current console.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

See Also

- Set-Variable

- New-Variable

- Clear-Variable

- Remove-Variable

Get-WinEvent

Gets events from event logs and event tracing log files on local and remote computers.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

Example 5

Example 6

Example 7

Example 8

Example 9

Example 10

Example 11

Example 12

Example 13

Example 14

Example 15

Example 16

See Also

- Get-EventLog

- Get-Counter

- about_EventLogs

Get-WmiObject

Gets instances of Windows Management Instrumentation (WMI) classes or information about the available classes.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

Example 5

Example 6

Example 7

See Also

- Invoke-WmiMethod

- Remove-WmiObject

- Set-WmiInstance

- Get-WSManInstance

- Invoke-WSManAction

- New-WSManInstance

- Remove-WSManInstance

Get-WSManCredSSP

Gets the Credential Security Service Provider-related configuration for the client.

Syntax

Description

Parameters

Inputs and Outputs

Example 1

See Also

- Connect-WSMan

- Disable-WSManCredSSP

- Disconnect-WSMan

- Enable-WSManCredSSP

- Get-WSManInstance

- Invoke-WSManAction

- New-WSManInstance

- New-WSManSessionOption

- Remove-WSManInstance

- Set-WSManInstance

- Set-WSManQuickConfig

- Test-WSMan

Get-WSManInstance

Displays management information for a resource instance specified by a Resource URI.

Syntax

Description

Parameters

Inputs and Outputs

Example 1

Example 2

Example 3

Example 4

Example 5

Example 6

Example 7

Example 8

Example 9

See Also

- Connect-WSMan

- Disable-WSManCredSSP

- Disconnect-WSMan

- Enable-WSManCredSSP

- Get-WSManCredSSP

- Invoke-WSManAction

- New-WSManInstance

- New-WSManSessionOption

- Remove-WSManInstance

- Set-WSManInstance

- Set-WSManQuickConfig

- Test-WSMan

Group-Object

Groups objects that contain the same value for specified properties.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

Example 5

Example 6

Example 7

Example 8

Example 9

Import-Alias

Imports an alias list from a file.

Syntax

Description

Parameters

Inputs and Outputs

Example 1

See Also

- Export-Alias

- Get-Alias

- New-Alias

- Set-Alias

Import-Clixml

Imports a CLIXML file and creates corresponding objects within Windows PowerShell.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Import-Counter

Imports performance counter log files (.blg, .csv, .tsv) and creates the objects that represent each counter sample in the log.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

Example 5

Example 6

Example 7

Example 8

Example 9

See Also

- Get-Counter

- Export-Counter

Import-CSV

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

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

Example 5

See Also

- Export-CSV

- ConvertTo-CSV

- ConvertFrom-CSV

Import-LocalizedData

Imports language-specific data into scripts and functions based on the UI culture that is selected for the operating system.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

Example 5

See Also

- about_Script_Internationalization

Import-Module

Adds modules to the current session.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

Example 5

Example 6

Example 7

Example 8

Example 9

See Also

- Get-Module

- New-Module

- Remove-Module

- Export-ModuleMember

- about_Modules

Import-PSSession

Imports commands from another session into the current session.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

Example 5

Example 6

Example 7

Example 8

Example 9

See Also

- about_Command_Precedence

- New-PSSession

- Export-PSSession

- about_Jobs

- about_PSSessions

Invoke-Command

Runs commands on local and remote computers.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

Example 5

Example 6

Example 7

Example 8

Example 9

Example 10

Example 11

Example 12

Example 13

Example 14

Example 15

See Also

- about_Remote

- about_PSSessions

- New-PSSession

- Get-PSSession

- Remove-PSSession

- Enter-PSSession

- Exit-PSSession

- WS-Management Provider

Invoke-Expression

Runs commands or expressions on the local computer.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

See Also

- Invoke-Command

Invoke-History

Runs commands from the session history.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

Example 5

See Also

- about_History

- Get-History

- Add-History

- Clear-History

Invoke-Item

Performs the default action on the specified item.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

See Also

- about_Providers

- Clear-Item

- Get-Item

- Move-Item

- Set-Item

- New-Item

- Remove-Item

- Rename-Item

- Copy-Item

Invoke-WmiMethod

Calls Windows Management Instrumentation (WMI) methods.

Syntax

Description

Parameters

Inputs and Outputs

Example 1

Example 2

See Also

- Get-WmiObject

- Remove-WmiObject

- Set-WmiInstance

- Get-WSManInstance

- Invoke-WSManAction

- New-WSManInstance

- Remove-WSManInstance

Invoke-WSManAction

Invokes an action on the object that is specified by the Resource URI and by the selectors.

Syntax

Description

Parameters

Inputs and Outputs

Example 1

Example 2

Example 3

Example 4

See Also

- Connect-WSMan

- Disable-WSManCredSSP

- Disconnect-WSMan

- Enable-WSManCredSSP

- Get-WSManCredSSP

- Get-WSManInstance

- New-WSManInstance

- New-WSManSessionOption

- Remove-WSManInstance

- Set-WSManInstance

- Set-WSManQuickConfig

- Test-WSMan

- Invoke-WmiMethod

Join-Path

Combines a path and a child path into a single path. The provider supplies the path delimiters.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

Example 5

See Also

- about_Providers

- Test-Path

- Split-Path

- Resolve-Path

- Convert-Path

Limit-EventLog

Sets the event log properties that limit the size of the event log and the age of its entries.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

See Also

- Clear-EventLog

- Get-EventLog

- Limit-EventLog

- New-EventLog

- Remove-EventLog

- Show-Eventlog

- Write-EventLog

- Get-WinEvent

Measure-Command

Measures the time it takes to run script blocks and cmdlets.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

See Also

- Trace-Command

- Invoke-Command

Measure-Object

Calculates the numeric properties of objects, and the characters, words, and lines in string objects, such as files of text.

Syntax

Description

Parameters

Inputs and Outputs

Example 1

Example 2

Example 3

Example 4

Example 5

Example 6

See Also

- Compare-Object

- ForEach-Object

- Group-Object

- New-Object

- Select-Object

- Sort-Object

- Tee-Object

- Where-Object

Move-Item

Moves an item from one location to another.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

Example 5

Example 6

See Also

- about_Providers

- Clear-Item

- Get-Item

- Invoke-Item

- Set-Item

- New-Item

- Remove-Item

- Rename-Item

- Copy-Item

Move-ItemProperty

Moves a property from one location to another.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

See Also

- about_Providers

- Clear-ItemProperty

- New-ItemProperty

- Copy-ItemProperty

- Rename-ItemProperty

- Get-ItemProperty

- Set-ItemProperty

- Remove-ItemProperty

New-Alias

Creates a new alias.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

See Also

- Set-Alias

- Get-Alias

- Export-Alias

- Import-Alias

New-Event

Creates a new event.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

See Also

- Register-ObjectEvent

- Register-EngineEvent

- Register-WmiEvent

- Unregister-Event

- Get-Event

- Remove-Event

- Wait-Event

New-EventLog

Creates a new event log and a new event source on a local or remote computer.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

See Also

- Clear-EventLog

- Get-EventLog

- Limit-EventLog

- New-EventLog

- Remove-EventLog

- Show-Eventlog

- Write-EventLog

- Get-WinEvent

New-Item

Creates a new item.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

See Also

- about_Providers

- Get-Item

- Set-Item

- Remove-Item

- Clear-Item

- Invoke-Item

- Rename-Item

- Move-Item

- Copy-Item

New-ItemProperty

Creates a new property for an item and sets its value. For example, you can use New-ItemProperty to create and change registry values and data, which are properties of a registry key.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

See Also

- about_Providers

- Clear-ItemProperty

- Copy-ItemProperty

- Move-ItemProperty

- Rename-ItemProperty

- Get-ItemProperty

- Set-ItemProperty

- Remove-ItemProperty

New-Module

Creates a new dynamic module that exists only in memory.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

Example 5

Example 6

See Also

- Get-Module

- Import-Module

- Remove-Module

- Export-ModuleMember

- about_Modules

New-ModuleManifest

Creates a new module manifest.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

See Also

- Import-Module

- Get-Module

- New-Module

- Remove-Module

- Export-ModuleMember

- Test-ModuleManifest

- about_Modules

New-Object

Creates an instance of a Microsoft .NET Framework or COM object.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

See Also

- Compare-Object

- Select-Object

- Sort-Object

- ForEach-Object

- Group-Object

- Measure-Object

- Tee-Object

- Where-Object

New-PSDrive

Creates a Windows PowerShell drive in the current session.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

See Also

- about_Providers

- Get-PSDrive

- Remove-PSDrive

New-PSSession

Creates a persistent connection to a local or remote computer.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

Example 5

Example 6

Example 7

Example 8

Example 9

Example 10

Example 11

See Also

- about_PSSessions

- about_Remote

- Get-PSSession

- Remove-PSSession

- Enter-PSSession

- Exit-PSSession

- Invoke-Command

New-PSSessionOption

Creates an object that contains advanced options for a PSSession.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

Example 5

Example 6

See Also

- Enter-PSSession

- New-PSSession

- Invoke-Command

New-Service

Creates a new Windows service.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

See Also

- Get-Service

- Start-Service

- Stop-Service

- Restart-Service

- Resume-Service

- Set-Service

- Suspend-Service

New-TimeSpan

Creates a TimeSpan object.

Syntax

Description

Parameters

Inputs and Outputs

Example 1

Example 2

Example 3

See Also

- Set-Date

- Get-Date

New-Variable

Creates a new variable.

Syntax

Description

Parameters

Inputs and Outputs

Example 1

Example 2

Example 3

Example 4

See Also

- Get-Variable

- Set-Variable

- Remove-Variable

- Clear-Variable

New-WebServiceProxy

Creates a Web service proxy object that lets you use and manage the Web service in Windows PowerShell.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

See Also

- New-Service

New-WSManInstance

Creates a new instance of a management resource.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

See Also

- Connect-WSMan

- Disable-WSManCredSSP

- Disconnect-WSMan

- Enable-WSManCredSSP

- Get-WSManCredSSP

- Get-WSManInstance

- Invoke-WSManAction

- New-WSManSessionOption

- Remove-WSManInstance

- Set-WSManInstance

- Set-WSManQuickConfig

- Test-WSMan

New-WSManSessionOption

Creates a WS-Management session option hash table to use as input parameters to the following WS-Management cmdlets: Get-WSManInstance Set-WSManInstance Invoke-WSManAction Connect-WSMan

Syntax

Description

Parameters

Inputs and Outputs

See Also

- Connect-WSMan

- Disable-WSManCredSSP

- Disconnect-WSMan

- Enable-WSManCredSSP

- Get-WSManCredSSP

- Get-WSManInstance

- Invoke-WSManAction

- New-WSManInstance

- Remove-WSManInstance

- Set-WSManInstance

- Set-WSManQuickConfig

- Test-WSMan

Out-Default

Sends the output to the default formatter and to the default output cmdlet.

Syntax

Description

Parameters

Inputs and Outputs

Out-File

Sends output to a file.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

See Also

- Out-String

- Out-Null

- Out-Host

- Out-Printer

- Out-Default

- Tee-Object

Out-GridView

Sends output to an interactive table in a separate window.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

Example 5

Example 6

Out-Host

Sends output to the command line.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

See Also

- Out-Printer

- Out-Null

- Out-File

- Out-String

- Out-Default

- Write-Host

Out-Null

Deletes output instead of sending it to the console.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

See Also

- Out-Printer

- Out-Host

- Out-File

- Out-String

- Out-Default

Out-Printer

Sends output to a printer.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

See Also

- Out-Host

- Out-Null

- Out-String

- Out-File

- Out-Default

Out-String

Sends objects to the host as a series of strings.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

See Also

- Out-File

- Out-Null

- Out-Host

- Out-Printer

- Out-Default

Pop-Location

Changes the current location to the location most recently pushed onto the stack. You can pop the location from the default stack or from a stack that you create by using the Push-Location cmdlet.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

See Also

- about_Providers

- Push-Location

- Set-Location

- Get-Location

Push-Location

Adds the current location to the top of a list of locations (a "stack").

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

See Also

- about_Providers

- Pop-Location

- Set-Location

- Get-Location

Read-Host

Reads a line of input from the console.

Syntax

Description

Parameters

Inputs and Outputs

Example 1

Example 2

See Also

- Get-Host

- Out-Host

- Write-Host

- ConvertFrom-SecureString

Receive-Job

Gets the results of the Windows PowerShell background jobs in the current session.

Syntax

Description

Parameters

Inputs and Outputs

Example 1

Example 2

Example 3

Example 4

See Also

- about_Jobs

- about_Job_Details

- about_Remote_Jobs

- Start-Job

- Get-Job

- Wait-Job

- Stop-Job

- Remove-Job

- Invoke-Command

Register-EngineEvent

Subscribes to events that are generated by the Windows PowerShell engine and by the New-Event cmdlet.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

See Also

- Register-ObjectEvent

- Register-WmiEvent

- Unregister-Event

- Get-Event

- New-Event

- Remove-Event

- Wait-Event

- Get-Job

- Receive-Job

- Remove-Job

- Wait-Job

Register-ObjectEvent

Subscribes to the events that are generated by a Microsoft .NET Framework object.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

See Also

- Register-EngineEvent

- Register-WmiEvent

- Unregister-Event

- Get-Event

- New-Event

- Remove-Event

- Wait-Event

Register-PSSessionConfiguration

Creates and registers a new session configuration.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

Example 5

See Also

- about_Session_Configurations

- Disable-PSSessionConfiguration

- Enable-PSSessionConfiguration

- Get-PSSessionConfiguration

- Set-PSSessionConfiguration

- Unregister-PSSessionConfiguration

- WS-Management Provider

Register-WmiEvent

Subscribes to a Windows Management Instrumentation (WMI) event.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

See Also

- Register-ObjectEvent

- Register-EngineEvent

- Unregister-Event

- Get-Event

- New-Event

- Remove-Event

- Wait-Event

Remove-Computer

Remove the local computer from a workgroup or domain.

Syntax

Description

Parameters

Inputs and Outputs

Example 1

Example 2

See Also

- Add-Computer

- Checkpoint-Computer

- Remove-Computer

- Restart-Computer

- Restore-Computer

- Stop-Computer

- Test-Connection

Remove-Event

Deletes events from the event queue.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

See Also

- Register-ObjectEvent

- Register-EngineEvent

- Register-WmiEvent

- Unregister-Event

- Get-Event

- New-Event

- Remove-Event

- Wait-Event

Remove-EventLog

Deletes an event log or unregisters an event source.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

Example 5

See Also

- Clear-EventLog

- Get-EventLog

- Limit-EventLog

- New-EventLog

- Remove-EventLog

- Show-Eventlog

- Write-EventLog

- Get-WinEvent

Remove-Item

Deletes the specified items.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

Example 5

See Also

- about_Providers

- Clear-Item

- Copy-Item

- Get-Item

- Invoke-Item

- Move-Item

- New-Item

- Remove-ItemProperty

- Rename-Item

- Set-Item

Remove-ItemProperty

Deletes the property and its value from an item.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

See Also

- about_Providers

- Clear-ItemProperty

- Copy-ItemProperty

- Get-ItemProperty

- Move-ItemProperty

- New-ItemProperty

- Remove-Item

- Rename-ItemProperty

- Set-ItemProperty

Remove-Job

Deletes a Windows PowerShell background job.

Syntax

Description

Parameters

Inputs and Outputs

Example 1

Example 2

Example 3

Example 4

Example 5

Example 6

Example 7

See Also

- about_Jobs

- about_Job_Details

- about_Remote_Jobs

- Start-Job

- Get-Job

- Receive-Job

- Wait-Job

- Stop-Job

- Invoke-Command

Remove-Module

Removes modules from the current session.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

See Also

- Get-Module

- Import-Module

- about_Modules

Remove-PSBreakpoint

Deletes breakpoints from the current console.

Syntax

Description

Parameters

Inputs and Outputs

Example 1

Example 2

Example 3

Example 4

See Also

- about_Debuggers

- Set-PSBreakpoint

- Get-PSBreakpoint

- Enable-PSBreakpoint

- Disable-PSBreakpoint

- Get-PSCallStack

Remove-PSDrive

Removes a Windows PowerShell drive from its location.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

See Also

- about_Providers

- Get-PSDrive

- New-PSDrive

Remove-PSSession

Closes one or more Windows PowerShell sessions (PSSessions).

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

Example 5

Example 6

See Also

- about_PSSessions

- about_Remote

- New-PSSession

- Get-PSSession

- Enter-PSSession

- Exit-PSSession

- Invoke-Command

Remove-PSSnapin

Removes Windows PowerShell snap-ins from the current session.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

See Also

- Add-PSSnapin

- Get-PSSnapin

- about_Profiles

Remove-Variable

Deletes a variable and its value.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

See Also

- Set-Variable

- Get-Variable

- Clear-Variable

- New-Variable

- about_Profiles

Remove-WmiObject

Deletes an instance of an existing Windows Management Instrumentation (WMI) class.

Syntax

Description

Parameters

Inputs and Outputs

Example 1

Example 2

See Also

- Get-WmiObject

- Invoke-WmiMethod

- Set-WmiInstance

- Get-WSManInstance

- Invoke-WSManAction

- New-WSManInstance

- Remove-WSManInstance

Remove-WSManInstance

Deletes a management resource instance.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

See Also

- Connect-WSMan

- Disable-WSManCredSSP

- Disconnect-WSMan

- Enable-WSManCredSSP

- Get-WSManCredSSP

- Get-WSManInstance

- Invoke-WSManAction

- New-WSManInstance

- New-WSManSessionOption

- Set-WSManInstance

- Set-WSManQuickConfig

- Test-WSMan

- Remove-WmiObject

Rename-Item

Renames an item in a Windows PowerShell provider namespace.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

See Also

- about_Providers

- Clear-Item

- Invoke-Item

- Move-Item

- Rename-ItemProperty

- Set-Item

- New-Item

- Remove-Item

- Get-Item

- Copy-Item

Rename-ItemProperty

Renames a property of an item.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

See Also

- about_Providers

- Rename-Item

- Clear-ItemProperty

- Copy-ItemProperty

- Get-ItemProperty

- Move-ItemProperty

- New-ItemProperty

- Remove-ItemProperty

- Set-ItemProperty

Reset-ComputerMachinePassword

Resets the machine account password for the computer.

Syntax

Description

Parameters

Inputs and Outputs

Example 1

Example 2

Example 3

Resolve-Path

Resolves the wildcard characters in a path, and displays the path contents.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

Example 5

Example 6

See Also

- about_Providers

- Test-Path

- Split-Path

- Convert-Path

- Join-Path

Restart-Computer

Restarts ("reboots") the operating system on local and remote computers.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

Example 5

See Also

- Add-Computer

- Checkpoint-Computer

- Remove-Computer

- Restore-Computer

- Stop-Computer

- Test-Connection

Restart-Service

Stops and then starts one or more services.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

See Also

- Start-Service

- Stop-Service

- Suspend-Service

- Resume-Service

- New-Service

- Get-Service

- Set-Service

Restore-Computer

Starts a system restore on the local computer.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

See Also

- Get-ComputerRestorePoint

- Enable-ComputerRestore

- Disable-ComputerRestore

- Restart-Computer

Resume-Service

Resumes one or more suspended (paused) services.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

See Also

- Get-Service

- Start-Service

- Stop-Service

- Restart-Service

- Suspend-Service

- Set-Service

- New-Service

Select-Object

Selects specified properties of an object or set of objects. It can also select unique objects from an array of objects, or it can select a specified number of objects from the beginning or end of an array of objects.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

Example 5

Example 6

Example 7

See Also

- Where-Object

- Group-Object

- Sort-Object

Select-String

Finds text in strings and files.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

Example 5

Example 6

Example 7

Example 8

Example 9

See Also

- about_Comparison_Operators

- about_Regular_Expressions

Select-Xml

Finds text in an XML string or document.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

Example 5

See Also

- ConvertTo-XML

Send-MailMessage

Sends an e-mail message.

Syntax

Description

Parameters

Inputs and Outputs

Example 1

Example 2

Example 3

Set-Acl

Changes the security descriptor of a specified resource, such as a file or a registry key.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

See Also

- Get-Acl

Set-Alias

Creates or changes an alias (alternate name) for a cmdlet or other command element in the current Windows PowerShell session.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

Example 5

See Also

- Get-Alias

- New-Alias

- Export-Alias

- Import-Alias

Set-AuthenticodeSignature

Adds an Authenticode signature to a Windows PowerShell script or other file.

Syntax

Description

Parameters

Inputs and Outputs

Example 1

Example 2

Example 3

See Also

- about_Signing

- about_Execution_Policies

- Get-AuthenticodeSignature

- Get-PfxCertificate

- Get-ExecutionPolicy

- Set-ExecutionPolicy

Set-Content

Writes or replaces the content in an item with new content.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

See Also

- about_Providers

- Add-Content

- Get-Content

- Clear-Content

Set-Date

Changes the system time on the computer to a time that you specify.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

See Also

- Get-Date

- New-TimeSpan

Set-ExecutionPolicy

Changes the user preference for the Windows PowerShell execution policy.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

Example 5

See Also

- Get-ExecutionPolicy

- Set-AuthenticodeSignature

- Get-AuthenticodeSignature

- about_Execution_Policies

- about_Signing

Set-Item

Changes the value of an item to the value specified in the command.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

See Also

- about_Providers

- Get-Item

- New-Item

- Remove-Item

- Clear-Item

- Invoke-Item

- Rename-Item

- Move-Item

- Copy-Item

Set-ItemProperty

Creates or changes the value of a property of an item.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

See Also

- about_Providers

- Get-ItemProperty

- New-ItemProperty

- Clear-ItemProperty

- Remove-ItemProperty

- Rename-ItemProperty

- Move-ItemProperty

- Copy-ItemProperty

Set-Location

Sets the current working location to a specified location.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

See Also

- about_Providers

- Get-Location

- Pop-Location

- Push-Location

Set-PSBreakpoint

Sets a breakpoint on a line, command, or variable.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

Example 5

Example 6

Example 7

See Also

- about_Debuggers

- Get-PSBreakpoint

- Enable-PSBreakpoint

- Disable-PSBreakpoint

- Remove-PSBreakpoint

- Get-PSCallStack

Set-PSDebug

Turns script debugging features on and off, sets the trace level, and toggles strict mode.

Syntax

Description

Parameters

Inputs and Outputs

Example 1

Example 2

Example 3

Example 4

See Also

- about_Debuggers

- Debug-Process

- Set-PSBreakpoint

- Set-StrictMode

- Write-Debug

Set-PSSessionConfiguration

Changes the properties of a registered session configuration.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

See Also

- about_Session_Configurations

- Disable-PSSessionConfiguration

- Enable-PSSessionConfiguration

- Get-PSSessionConfiguration

- Register-PSSessionConfiguration

- Unregister-PSSessionConfiguration

- WS-Management Provider

Set-Service

Starts, stops, and suspends a service, and changes its properties.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

Example 5

Example 6

See Also

- Get-Service

- Start-Service

- Stop-Service

- Restart-Service

- Resume-Service

- Suspend-Service

- New-Service

Set-StrictMode

Establishes and enforces coding rules in expressions, scripts, and script blocks.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

See Also

- about_Debuggers

- about_Scopes

- Set-PSDebug

Set-TraceSource

Configures, starts, and stops a trace of Windows PowerShell components.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

See Also

- Get-TraceSource

- Trace-Command

- Set-PSDebug

Set-Variable

Sets the value of a variable. Creates the variable if one with the requested name does not exist.

Syntax

Description

Parameters

Inputs and Outputs

Example 1

Example 2

Example 3

See Also

- Get-Variable

- New-Variable

- Remove-Variable

- Clear-Variable

Set-WmiInstance

Creates or updates an instance of an existing Windows Management Instrumentation (WMI) class.

Syntax

Description

Parameters

Inputs and Outputs

Example 1

Example 2

Example 3

See Also

- Get-WmiObject

- Invoke-WmiMethod

- Remove-WmiObject

- Get-WSManInstance

- Invoke-WSManAction

- New-WSManInstance

- Remove-WSManInstance

Set-WSManInstance

Modifies the management information that is related to a resource.

Syntax

Description

Parameters

Inputs and Outputs

Example 1

Example 2

Example 3

See Also

- Connect-WSMan

- Disable-WSManCredSSP

- Disconnect-WSMan

- Enable-WSManCredSSP

- Get-WSManCredSSP

- Get-WSManInstance

- Invoke-WSManAction

- New-WSManInstance

- New-WSManSessionOption

- Remove-WSManInstance

- Set-WSManQuickConfig

- Test-WSMan

Set-WSManQuickConfig

Configures the local computer for remote management.

Syntax

Description

Parameters

Inputs and Outputs

Example 1

Example 2

See Also

- Connect-WSMan

- Disable-WSManCredSSP

- Disconnect-WSMan

- Enable-PSRemoting

- Enable-WSManCredSSP

- Get-WSManCredSSP

- Get-WSManInstance

- Invoke-WSManAction

- New-PSSession

- New-WSManInstance

- New-WSManSessionOption

- Test-WSMan

Show-Eventlog

Displays the event logs of the local or a remote computer in Event Viewer.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

See Also

- Clear-EventLog

- Get-EventLog

- Limit-EventLog

- New-EventLog

- Remove-EventLog

- Write-EventLog

- Get-WinEvent

Sort-Object

Sorts objects by property values.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

Example 5

Example 6

Example 7

See Also

- Group-Object

Split-Path

Returns the specified part of a path.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

Example 5

Example 6

See Also

- about_Providers

- Test-Path

- Convert-Path

- Resolve-Path

- Join-Path

Start-Job

Starts a Windows PowerShell background job.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

Example 5

Example 6

See Also

- about_Jobs

- about_Job_Details

- about_Remote_Jobs

- Get-Job

- Receive-Job

- Wait-Job

- Stop-Job

- Remove-Job

- Invoke-Command

Start-Process

Starts one or more processes on the local computer.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

See Also

- Start-Service

- Get-Process

- Stop-Process

- Wait-Process

- Debug-Process

Start-Service

Starts one or more stopped services.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

See Also

- Get-Service

- Suspend-Service

- Stop-Service

- Restart-Service

- Resume-Service

- Set-Service

- New-Service

Start-Sleep

Suspends the activity in a script or session for the specified period of time.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Start-Transaction

Starts a transaction.

Syntax

Description

Parameters

Inputs and Outputs

Example 1

Example 2

Example 3

Example 4

Example 5

Example 6

Example 7

See Also

- about_Transactions

- Get-Transaction

- Complete-Transaction

- Undo-Transaction

- Use-Transaction

Start-Transcript

Creates a record of all or part of a Windows PowerShell session in a text file.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

See Also

- Stop-Transcript

Stop-Computer

Stops (shuts down) local and remote computers.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

Example 5

See Also

- Add-Computer

- Checkpoint-Computer

- Remove-Computer

- Restart-Computer

- Restore-Computer

- Test-Connection

Stop-Job

Stops a Windows PowerShell background job.

Syntax

Description

Parameters

Inputs and Outputs

Example 1

Example 2

Example 3

Example 4

Example 5

Example 6

Example 7

Example 8

See Also

- about_Jobs

- about_Job_Details

- about_Remote_Jobs

- Start-Job

- Get-Job

- Receive-Job

- Wait-Job

- Remove-Job

- Invoke-Command

Stop-Process

Stops one or more running processes.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

See Also

- Get-Process

- Start-Process

- Stop-Process

- Wait-Process

- Debug-Process

Stop-Service

Stops one or more running services.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

See Also

- Get-Service

- Suspend-Service

- Start-Service

- Restart-Service

- Resume-Service

- Set-Service

- New-Service

Stop-Transcript

Stops a transcript.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

See Also

- Start-Transcript

Suspend-Service

Suspends (pauses) one or more running services.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

See Also

- Get-Service

- Start-Service

- Stop-Service

- Restart-Service

- Resume-Service

- Set-Service

- New-Service

Tee-Object

Saves command output in a file or variable, and displays it in the console.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

See Also

- about_Redirection

- Select-Object

Test-ComputerSecureChannel

Tests and repairs the secure channel between the local computer and its domain.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

Example 5

See Also

- Checkpoint-Computer

- Restart-Computer

- Stop-Computer

- Reset-ComputerMachinePassword

Test-Connection

Sends ICMP echo request packets ("pings") to one or more computers.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

Example 5

Example 6

Example 7

See Also

- Add-Computer

- Restart-Computer

- Stop-Computer

Test-ModuleManifest

Verifies that a module manifest file accurately describes the contents of a module.

Syntax

Description

Parameters

Inputs and Outputs

Example 1

Example 2

Example 3

See Also

- Import-Module

- Get-Module

- New-Module

- Remove-Module

- Export-ModuleMember

- New-ModuleManifest

- about_Modules

Test-Path

Determines whether all elements of a path exist.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

Example 5

See Also

- about_Providers

- Convert-Path

- Split-Path

- Resolve-Path

- Join-Path

Test-WSMan

Tests whether the WinRM service is running on a local or remote computer.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

See Also

- Connect-WSMan

- Disable-WSManCredSSP

- Disconnect-WSMan

- Enable-WSManCredSSP

- Get-WSManCredSSP

- Get-WSManInstance

- Invoke-WSManAction

- New-WSManInstance

- New-WSManSessionOption

- Remove-WSManInstance

- Set-WSManInstance

- Set-WSManQuickConfig

Trace-Command

Configures and starts a trace of the specified expression or command.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

See Also

- Get-TraceSource

- Set-TraceSource

Undo-Transaction

Rolls back the active transaction.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

See Also

- about_Transactions

- about_Providers

- Start-Transaction

- Get-Transaction

- Complete-Transaction

- Use-Transaction

Unregister-Event

Cancels an event subscription.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

See Also

- Register-ObjectEvent

- Register-EngineEvent

- Register-WmiEvent

- Unregister-Event

- Get-Event

- New-Event

- Remove-Event

- Wait-Event

- Get-EventSubscriber

Unregister-PSSessionConfiguration

Deletes registered session configurations from the computer.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

See Also

- about_Session_Configurations

- Disable-PSSessionConfiguration

- Enable-PSSessionConfiguration

- Get-PSSessionConfiguration

- Register-PSSessionConfiguration

- Set-PSSessionConfiguration

- WS-Management Provider

Update-FormatData

Updates the formatting data in the current session.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Update-List

Adds items to and removes items from a property value that contains a collection of objects.

Syntax

Description

Parameters

Inputs and Outputs

Example 1

Example 2

Example 3

Example 4

See Also

- Select-Object

Update-TypeData

Updates the current extended type configuration by reloading the *.types.ps1xml files into memory.

Syntax

Description

Parameters

Inputs and Outputs

Example 1

Example 2

Use-Transaction

Adds the script block to the active transaction.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

See Also

- about_Transactions

- Start-Transaction

- Get-Transaction

- Complete-Transaction

- Undo-Transaction

Wait-Event

Waits until a particular event is raised before continuing to run.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

See Also

- Register-ObjectEvent

- Register-EngineEvent

- Register-WmiEvent

- Unregister-Event

- Get-Event

- New-Event

- Remove-Event

- Wait-Event

- Get-EventSubscriber

Wait-Job

Suppresses the command prompt until one or all of the Windows PowerShell background jobs running in the session are complete.

Syntax

Description

Parameters

Inputs and Outputs

Example 1

Example 2

Example 3

Example 4

Example 5

Example 6

Example 7

Example 8

Example 9

Example 10

See Also

- about_Jobs

- about_Job_Details

- about_Remote_Jobs

- Start-Job

- Get-Job

- Receive-Job

- Stop-Job

- Remove-Job

- Invoke-Command

Wait-Process

Waits for the processes to be stopped before accepting more input.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

See Also

- Get-Process

- Start-Process

- Stop-Process

- Wait-Process

- Debug-Process

Where-Object

Creates a filter that controls which objects will be passed along a command pipeline.

Syntax

Description

Parameters

Inputs and Outputs

Example 1

Example 2

Example 3

Example 4

Write-Debug

Writes a debug message to the console.

Syntax

Description

Parameters

Inputs and Outputs

Example 1

Example 2

Example 3

See Also

- Write-Verbose

- Write-Error

- Write-Host

- Write-Progress

- Write-Output

- Write-Warning

Write-Error

Writes an object to the error stream.

Syntax

Description

Parameters

Inputs and Outputs

Example 1

Example 2

Example 3

See Also

- Write-Debug

- Write-Verbose

- Write-Output

- Write-Host

- Write-Progress

- Write-Warning

Write-EventLog

Writes an event to an event log.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

See Also

- Clear-EventLog

- Get-EventLog

- Limit-EventLog

- New-EventLog

- Remove-EventLog

- Show-Eventlog

- Write-EventLog

- Get-WinEvent

Write-Host

Writes customized output to a host.

Syntax

Description

Parameters

Inputs and Outputs

Example 1

Example 2

Example 3

Example 4

See Also

- Write-Verbose

- Write-Error

- Write-Progress

- Write-Debug

- Write-Output

- Write-Warning

- Out-Host

Write-Output

Sends the specified objects to the next command in the pipeline. If the command is the last command in the pipeline, the objects are displayed in the console.

Syntax

Description

Parameters

Inputs and Outputs

Example 1

Example 2

See Also

- Write-Debug

- Write-Verbose

- Write-Error

- Write-Progress

- Write-Host

- Write-Warning

- Tee-Object

Write-Progress

Displays a progress bar within a Windows PowerShell command window.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

See Also

- Write-Verbose

- Write-Error

- Write-Host

- Write-Debug

- Write-Output

- Write-Warning

Write-Verbose

Writes text to the verbose message stream.

Syntax

Description

Parameters

Inputs and Outputs

Example 1

Example 2

See Also

- Write-Error

- Write-Warning

- about_Preference_Variables

Write-Warning

Writes a warning message.

Syntax

Description

Parameters

Inputs and Outputs

Notes

Example 1

Example 2

Example 3

Example 4

See Also

- about_Preference_Variables

- about_CommonParameters

- Write-Debug

- Write-Error

- Write-Host

- Write-Output

- Write-Progress

- Write-Verbose

Windows PowerShell Provider Help Topics

Windows PowerShell providers are .NET programs that make the data in a specialized data store available in Windows PowerShell so that you can easily view and manage it. The data that a provider exposes appears in a drive, much like a file system drive. For more information, see about_Providers.

This section contains the help topics for the providers that are installed with Windows PowerShell.

Provider

Description

Alias Provider

Provides access to the Windows PowerShell aliases and their values.

Certificate Provider

Provides read-only access to X509 certificate stores and certificates.

Environment Provider

Provides access to the Windows environment variables.

FileSystem Provider

Provides access to files and directories.

Function Provider

Provides access to the functions defined in Windows PowerShell.

Registry Provider

Provides access to the system registry keys and values.

Variable Provider

Provides access to Windows PowerShell variables and their values.

WS-Management Provider

Provides access to WSMan configuration information.

See Also

- Windows PowerShell Cmdlet Help Topics

- Windows PowerShell About Help Topics

- Windows PowerShell Getting Started Guide

- PowerShell.exe Console Help

Alias Provider

PROVIDER NAME

DRIVES

SHORT DESCRIPTION

DETAILED DESCRIPTION

EXAMPLES

DYNAMIC PARAMETERS

See Also

- about_Aliases

- about_Providers

Certificate Provider

PROVIDER NAME

DRIVES

SHORT DESCRIPTION

DETAILED DESCRIPTION

EXAMPLES

DYNAMIC PARAMETERS

See Also

- about_Providers

- about_Signing

- Get-AuthenticodeSignature

- Set-AuthenticodeSignature

- Get-PfxCertificate

Environment Provider

PROVIDER NAME

DRIVES

SHORT DESCRIPTION

DETAILED DESCRIPTION

EXAMPLES

See Also

- about_Providers

FileSystem Provider

PROVIDER NAME

DRIVES

SHORT DESCRIPTION

DETAILED DESCRIPTION

EXAMPLES

DYNAMIC PARAMETERS

See Also

- about_Providers

Function Provider

PROVIDER NAME

DRIVES

SHORT DESCRIPTION

DETAILED DESCRIPTION

EXAMPLES

DYNAMIC PARAMETERS

See Also

- about_Functions

- about_Providers

Registry Provider

PROVIDER NAME

DRIVES

SHORT DESCRIPTION

DETAILED DESCRIPTION

CAPABILITIES

EXAMPLES

DYNAMIC PARAMETERS

See Also

- about_Providers

Variable Provider

PROVIDER NAME

DRIVES

SHORT DESCRIPTION

DETAILED DESCRIPTION

EXAMPLES

See Also

- about_Variables

- about_Automatic_Variables

- about_Providers

WS-Management Provider

PROVIDER NAME

DRIVES

SHORT DESCRIPTION

DETAILED DESCRIPTION

EXAMPLES

DYNAMIC PARAMETERS

Windows PowerShell Integrated Scripting Environment (ISE) Help

The Windows PowerShell Integrated Scripting Environment (ISE) is a host application that enables you to write, run, and test scripts and modules in a friendly environment. Key features such as syntax-coloring, tab completion, visual debugging, Unicode-compliance, and context-sensitive Help provide a rich scripting experience.

Features in the Windows PowerShell ISE include:

- A Command Pane for running interactive commands, just as you would in the Windows PowerShell console. Just type a command and press Enter.

- An Output Pane that captures the output of the commands.

- A Script Pane to create, edit, debug, and run, functions, scripts and modules.

- Multiple PowerShell tabs, each with its own Command Pane and Script Pane to allow you to simultaneously work on several independent tasks.

- The ability to edit text in complex scripts and right-to-left languages.

Note:

Because Windows PowerShell ISE requires a user interface, it is not available on core installations of Windows Server. It is an optional component on server installations. Window PowerShell ISE is built on the Windows Presentation Foundation (WPF). If the graphical elements of Windows PowerShell ISE do not render correctly on your system, you might resolve the problem by adding or adjusting the graphics rendering settings on your system. This might be required if the computer has an older video driver or you are using virtualization software. For more information, see "Graphics Rendering Registry Settings" in the MSDN library at .

The following sections provide information that will help you to get started with the Windows PowerShell ISE.

- Exploring Windows PowerShell ISE

- Using Windows PowerShell ISE

- Accessibility in Windows PowerShell ISE

The following section describes the Windows PowerShell ISE object model and shows how you can use it in scripting.

- The Windows PowerShell ISE Scripting Object Model

See Also

- Windows PowerShell Getting Started Guide

- Windows PowerShell Help

Exploring Windows PowerShell ISE

You can use the Windows PowerShell Integrated Scripting Environment (ISE) to create, run, and debug commands and scripts. The Windows PowerShell ISE consists of the menu bar, Windows PowerShell tabs, the toolbar, script tabs, a Script Pane, an Output Pane, a Command Pane, a status bar, a text-size slider and context-sensitive Help.

Menu Bar

Windows PowerShell Tabs

Toolbar

Script Tab

Script Pane

Output Pane

Command Pane

Status Bar

Text-Size Slider

Context-Sensitive Help

See Also

- Windows PowerShell Integrated Scripting Environment (ISE) Help

- Using Windows PowerShell ISE

Using Windows PowerShell ISE

In this section

See Also

- Exploring Windows PowerShell ISE

- Windows PowerShell ISE Object Model Reference

- Accessibility in Windows PowerShell ISE

How to Use Tab Completion in the Script Pane and the Command Pane

Tab completion provides automatic Help when you are typing in the Script Pane or in the Command Pane. Use the following steps to take advantage of this feature:

To automatically complete a command entry

To automatically complete a cmdlet parameter entry

See Also

- Using Windows PowerShell ISE

- How to Enter and Run a Command in the Command Pane

How to Create a PowerShell Tab in Windows PowerShell ISE

PowerShell tabs allow you to simultaneously create and use several execution environments within the same application. Each PowerShell tab corresponds to an execution environment.

Note:

Variables, functions, and aliases that you create in one PowerShell tab do not carry over from one PowerShell tab to another.

Use the following steps to open and close a PowerShell tab. To rename a PowerShell tab, set the DisplayName property on the PowerShell Tab scripting object.

To create and use a new PowerShell tab

To create and use a new remote PowerShell tab

To close a PowerShell Tab

See Also

- Using Windows PowerShell ISE

How to Use the Command Pane

Use the topics below to write and run commands in the Command Pane.

In this section

See Also

- Using Windows PowerShell ISE

How to Enter and Run a Command in the Command Pane

Use the following steps to enter, run, or stop a command in the Command Pane.

To enter a command

To run a command

To stop a command

See Also

- How to Use the Command Pane

- How to Use Tab Completion in the Script Pane and the Command Pane

How to Edit Text in the Command Pane

Use the following steps to edit text in the Command Pane. You can copy, cut, and paste text. You can also undo and redo the last performed action. The keyboard shortcuts for performing these actions are the same as those used for all Windows applications.

To copy text in the Command Pane

To cut text in the Command Pane

To paste text into the Command Pane

To add a line in the Command Pane

To undo an action in the Command Pane

To redo an action in the Command Pane

See Also

- How to Use the Command Pane

- How to Use Tab Completion in the Script Pane and the Command Pane

How to Add Required Parameters in the Parameter Prompt Dialog Box

Parameters provide a way to select options or provide input to a Windows PowerShell cmdlet. Some parameters are required and others are optional. If you enter a cmdlet without specifying its required parameters, Windows PowerShell prompts you to enter each required parameter. In the Windows PowerShell console you are prompted at the command line. In Windows PowerShell ISE a Parameter Prompt dialog box appears that provides a parallel functionality to the Windows PowerShell console interactive behavior. The dialog box cycles through the required parameters in sequence.

Note:

An important point of difference between the Windows PowerShell console experience and the Windows PowerShell ISE experience is the way a required array parameter is entered. The Parameter Prompt dialog box provides an OK button that functions the same way as the ENTER key. After you enter a value for the array parameter, you are prompted for the next value when you click OK or when you press ENTER. Clicking OK or pressing ENTER without entering a value signals the end of the array, the same way that pressing the ENTER key without entering a value signals the end of the array on the Windows PowerShell console. Note that the Cancel button on the Parameter Prompt dialog box cancels the entire command and not the last entered value in the array. In that sense, the Cancel button is the counterpart for CTRL+C on the Windows PowerShell console.

Use of the Parameter Prompt Dialog Box

Use of the Parameter Prompt Dialog Box to Enter a Required Array Parameter

See Also

- about_Parameters

- about_Command_Syntax

- How to Use the Command Pane

How to Manage Results in the Output Pane

The Output Pane displays the results of the cmdlets you type and the scripts that you run. It also displays error messages.

Use the following steps to manage results in the Output Pane.

To select some or all of the results in the Output Pane

To copy and paste results from the Output Pane

To clear the results in the Output Pane

See Also

- Using Windows PowerShell ISE

How to Write and Run Scripts in the Script Pane

Use the topics below to create, edit, run, and save scripts in the Script Pane.

In this section

See Also

- Using Windows PowerShell ISE

How to Create and Run a Script

Use the following steps to create and run a script in the Script Pane.

You can open and edit a file type in the Script Pane. Specific file types of interest in Windows PowerShell are script files (.ps1), script data files (.psd1), and script module files (.psm1). These file types are syntax colored in the Script Pane editor. Other common file types you may open in the Script Pane are configuration files (.ps1xml), XML files, and text files.

Note:

The Windows PowerShell execution policy determines whether you can run scripts and load Windows PowerShell profiles and configuration files. The default execution policy, Restricted, prevents all scripts from running, and prevents loading profiles. To change the execution policy to allow profiles to load and be used, see about_Signing and Set-ExecutionPolicy

To create a new script file

To open an existing script

To display the file path

To run a script

To run a portion of a script

To stop a running script

See Also

- How to Write and Run Scripts in the Script Pane

- Using Windows PowerShell ISE

How to Edit Text in the Script Pane

Use the following steps to edit text in the Script Pane. You can copy, cut, paste, find, and replace text. You can also undo and redo the last action you just performed. The keyboard shortcuts for performing these actions are the same as those used for all Windows applications.

To enter text in the Script Pane

To find text in the Script Pane

To go to a particular line of text in the Script Pane

To copy text in the Script Pane

To cut text in the Script Pane

To paste text into the Script Pane

To undo an action in the Script Pane

To redo an action in the Script Pane

To replace text in the Script Pane

See Also

- Windows PowerShell About Help Topics

- Windows PowerShell Cmdlet Help Topics

- How to Create and Run a Script

- How to Save a Script

- How to Manage and Close Script Tabs

- How to Use Tab Completion in the Script Pane and the Command Pane

How to Save a Script

Use the following steps to save and name a script. An asterisk appears next to the script name to mark a file that has not been saved since it was altered. The asterisk disappears when the file is saved.

Note:

Windows PowerShell file types, namely, script files (.ps1), script data files (.psd1), and script module files (.psm1) are saved as Unicode.  However, some file types such as command scripts (.cmd) must be saved in the ANSI (ASCII) format to run properly.  If you create a command script using Windows PowerShell ISE, in order to save the file, use the SaveAs method on the $psISE.CurrentFile object.

To save a script

To save and name a script

See Also

- How to Create and Run a Script

- How to Edit Text in the Script Pane

- How to Manage and Close Script Tabs

How to Manage and Close Script Tabs

Use the following steps to manage files and to close them in the Script Pane.

To move from one script tab to another

To close a script tab

See Also

- How to Save a Script

- How to Edit Text in the Script Pane

- How to Save a Script

How to Debug Scripts in Windows PowerShell ISE

The topics in this section describe how to debug scripts on a local computer by using the Windows PowerShell ISE visual debugging features.

In this section

See Also

- Using Windows PowerShell ISE

How to Set, Remove, Disable, Enable, and List Breakpoints

You can set three types of breakpoints in the Windows PowerShell debugging environment: variable breakpoints, command breakpoints, and line breakpoints. Of these, in the Windows PowerShell ISE debugging environment, only line breakpoints highlighted and can be set by using the menu or the keyboard shortcuts. The other two types of breakpoints can still be set, but they are set from the command pane by using the Set-PSBreakpoint cmdlet. You can remove, enable, disable, and list all breakpoints. This section describes how you can perform debugging tasks in Windows PowerShell ISE by using the menus where available, and perform a wider range of commands from the Command Pane by using scripting.

Managing Breakpoints

See Also

- about_Debuggers

- Set-PSBreakpoint

- Get-PSBreakpoint

- Disable-PSBreakpoint

- Enable-PSBreakpoint

- Remove-PSBreakpoint

- Get-PSCallStack

How to Start, Stop, and Continue Debugging

Before you start debugging, you must set one or more breakpoint. You cannot set a breakpoint unless the script that you want to debug is saved. For directions on of how to set a breakpoint, see How to Set, Remove, Disable, Enable, and List Breakpoints or Set-PSBreakpoint. After you start debugging, you cannot edit a script until you stop debugging. A script that has one or more breakpoints set is automatically saved before it is run.

To start debugging

To continue debugging

To view the call stack

To stop debugging

See Also

- How to Set, Remove, Disable, Enable, and List Breakpoints

- Set-PSBreakpoint

- about_Debuggers

- Set-StrictMode

- How to Save a Script

- How to Debug Scripts in Windows PowerShell ISE

How to Step Over, Step Into, and Step Out While Debugging

Use the following information to debug a script by stepping through it.

Stepping is the process of running one statement at a time. You can stop on a line of code, and examine the values of variables and the state of the system. The following table describes common debugging tasks such as stepping over, stepping into, and stepping out.

Debugging Task

Description

How to accomplish it in PowerShell ISE

Step Into

Executes the current statement and then stops at the next statement. If the current statement is a function or script call, then the debugger steps into that function or script, otherwise it stops at the next statement.

In the Command Pane, type S and press ENTER, or, on the   Debug menu, click Step Into.

Step Over

Executes the current statement and then stops at the next statement. If the current statement is a function or script call then the debugger executes the whole function or script, and it stops at the next statement after the function call.

In the Command Pane, type V and press ENTER, or, on the   Debug menu, click Step Over.

Step Out

Steps out of the current function and up one level if the function is nested. If in the main body, the script is executed to the end, or to the next breakpoint. The skipped statements are executed, but not stepped through.

In the Command Pane, type O and press ENTER, or, on the   Debug menu, click Step Out.

Continue

Continues execution to the end, or to the next breakpoint. The skipped functions and invocations are executed, but not stepped through.

In the Command Pane, type C and press ENTER, or, on the   Debug menu, click Run/Continue.

Debugging a script

See Also

- about_Debuggers

- How to Debug Scripts in Windows PowerShell ISE

How to Use Profiles in Windows PowerShell ISE

Use the following topics to learn how to use profiles in the Windows PowerShell Integrated Scripting Environment (ISE).

Note:

Before performing the tasks in this section, see about_Profiles, or in the Command Pane, type, “get-help about_profiles” and press ENTER.

You can create one or more Windows PowerShell profiles for Windows PowerShell ISE and use them to add the variables, aliases, commands and functions that you use frequently. A profile affects every Windows PowerShell ISE session that you start. You can also use a profile to preserve the items that you customize in the Windows PowerShell ISE environment, such as color and font preferences.

Note:

The Windows PowerShell execution policy determines whether you can run scripts and load a profile or a configuration files. The default execution policy, “Restricted,” prevents all scripts from running, including profiles. If you use the “Restricted” policy, the profile does not load. For more information about execution policy, see about_Execution_Policies.

Selecting a Profile to Use in Windows PowerShell ISE

In this section

See Also

- about_Profiles

- Using Windows PowerShell ISE

How to Create Profiles in Windows PowerShell ISE

Before you create a profile, you must know what type of profile you want to create. For more information, see about_Profiles, or in the Command Pane, type, “get-help about_profiles” and press ENTER.

To create a new profile

To edit a profile

See Also

- about_Profiles

- about_Signing

- Set-ExecutionPolicy

- How to Use Profiles in Windows PowerShell ISE

- The Windows PowerShell ISE Scripting Object Model

Accessibility in Windows PowerShell ISE

The Accessibility Information topic in the Windows PowerShell ISE section contains accessibility information that you might find helpful as you work with Windows PowerShell Integrated Scripting Environment (ISE).

In this section

See Also

- Windows PowerShell Integrated Scripting Environment (ISE) Help

Accessibility Information

Microsoft is committed to making its products and services easier for everyone to use. The following topics provide information about the features, products, and services that make Windows PowerShell ISE more accessible for people with disabilities.

- Accessibility Features of Windows PowerShell ISE

- Accessibility Features of Windows PowerShell ISE Help

Accessibility Features of Windows PowerShell ISE

Accessibility Features of Windows PowerShell ISE Help

See Also

- Keyboard Shortcuts

- How to Change the Size and Location of the Command Pane and Script Pane

How to Change the Size and Location of the Command Pane and Script Pane

You can use the following steps to change the size and location of the Command Pane and the Script Pane. When you open the Windows PowerShell Integrated Scripting Environment (ISE) again, the size and location changes you made will be retained.

To resize the Command Pane

To move the Command Pane

To resize the Script Pane

To move the Script Pane

To hide the Script Pane

To display the Script Pane

To maximize the Script Pane

See Also

- Accessibility in Windows PowerShell ISE

Keyboard Shortcuts

Use the following keyboard shortcuts to perform actions in the Windows PowerShell Integrated Scripting Environment (ISE).

Keyboard shortcuts for editing text

Keyboard shortcuts for running scripts

Keyboard shortcuts for customizing the view

Keyboard shortcuts for debugging scripts

Keyboard shortcuts for Windows PowerShell tabs

Keyboard shortcuts for starting and exiting

The Windows PowerShell ISE Scripting Object Model

Windows PowerShell Integrated Scripting Environment (ISE) exposes its underlying scripting object model to allow users to write Windows PowerShell scripts that manipulate the various visual and functional aspects of Windows PowerShell ISE. Scripting objects, their properties, and their methods are defined specifically for this purpose.

In This Section

See Also

- Windows PowerShell Integrated Scripting Environment (ISE) Help

Purpose of the Windows PowerShell ISE Scripting Object Model

Objects are associated with the form and function of Windows PowerShell Integrated Scripting Environment (ISE). The object model reference provides details about the member properties and methods that these objects expose. Examples are provided to show how you can use scripts to directly access these methods and properties. The scripting object model makes the following range of tasks easier.

Customizing the appearance of the ISE

Enhancing the functionality of the ISE

Automating tasks

See Also

- The ISE object hierarchy

- Windows PowerShell ISE Object Model Reference

- The Windows PowerShell ISE Scripting Object Model

The ISE object hierarchy

This topic shows the hierarchy of objects that are part of the Windows PowerShell Integrated Scripting Environment (ISE). Clicking an object takes you to the reference documentation for the class in the Microsoft.PowerShell.Host.ISE namespace that defines the object.

$psISE Object

$psISE.CurrentFile

$psISE.CurrentPowerShellTab

$psISE.Options

See Also

- Windows PowerShell ISE Object Model Reference

- The Windows PowerShell ISE Scripting Object Model

Other Useful Scripting Objects

The following objects provide additional scripting functionality in Windows PowerShell ISE. They are not part of the $psISE hierarchy.

Useful Scripting objects

See Also

- The Windows PowerShell ISE Scripting Object Model

Windows PowerShell ISE Object Model Reference

Object Model Reference

See Also

- The ISE object hierarchy

- The Windows PowerShell ISE Scripting Object Model

The ISEEditor Object

An ISEEditor object is an instance of the Microsoft.PowerShell.Host.ISE.ISEEditor class. The Output Pane and the Command Pane editors are ISEEditor objects. Each ISEFile object has an associated ISEEditor object. The following sections list the methods and properties of an ISEEditor object.

Methods

Properties

Scripting Example

See Also

- The ISEFile Object

- The PowerShellTab Object

- Windows PowerShell ISE Object Model Reference

- The ISE object hierarchy

- The Windows PowerShell ISE Scripting Object Model

The ISEFile Object

An ISEFile object represents a file in Windows PowerShell Integrated Scripting Environment (ISE). It is an instance of the Microsoft.PowerShell.Host.ISE.ISEFile class. This topic lists its member methods and member properties. The $psISE.CurrentFile and the files in the Files collection in a Powershell tab are instances of the Microsoft.PowerShell.Host.ISE.ISEFile class.

Methods

Properties

See Also

- The ISEFileCollection Object

- Windows PowerShell ISE Object Model Reference

- The ISE object hierarchy

- The Windows PowerShell ISE Scripting Object Model

The ISEFileCollection Object

The ISEFileCollection object is a collection of ISEFile objects. The files collection associated with a PowerShellTab object is a member of this class. An example is the $psISE.CurrentPowerShellTab.Files collection.

Methods

See Also

- The ISEFile Object

- Windows PowerShell ISE Object Model Reference

- The ISE object hierarchy

- The Windows PowerShell ISE Scripting Object Model

The ISEMenuItem Object

An ISEMenuItem object is an instance of the Microsoft.PowerShell.Host.ISE.ISEMenuItem class. All menu objects on the Add-ons menu are members of the Microsoft.PowerShell.Host.ISE.ISEMenuItem class.

Properties

Scripting example

See Also

- The ISEMenuItemCollection Object

- Windows PowerShell ISE Object Model Reference

- The ISE object hierarchy

- The Windows PowerShell ISE Scripting Object Model

The ISEMenuItemCollection Object

An ISEMenuItemCollection is a collection of ISEMenuItem objects. It is an instance of the Microsoft.PowerShell.Host.ISE.ISEMenuItemCollection class. An example is the $psISE.CurrentPowerShellTab.AddOnsMenu.Submenus object that is used to customize the menus in the Windows PowerShell Integrated Scripting Environment (ISE).

Method

See Also

- The ISEMenuItem Object

- Windows PowerShell ISE Object Model Reference

- The ISE object hierarchy

- The Windows PowerShell ISE Scripting Object Model

The ISEOptions Object

The Options object represents various settings for the Windows PowerShell ISE. It is an instance of the Microsoft.PowerShell.Host.ISE.ISEOptions class.

Methods

Properties

See Also

- Windows PowerShell ISE Object Model Reference

- The ISE object hierarchy

- The Windows PowerShell ISE Scripting Object Model

The ObjectModelRoot Object

This topic describes an ObjectModelRoot object. It is an instance of the Microsoft.PowerShell.Host.ISE.ObjectModelRoot class. The $psISE object, which is the principal root object in Windows PowerShell Integrated Scripting Environment (ISE) belongs to this class. This topic describes the properties of the ObjectModelRoot object.

Properties

See Also

- Windows PowerShell ISE Object Model Reference

- The ISE object hierarchy

- The Windows PowerShell ISE Scripting Object Model

The PowerShellTab Object

The PowerShell tab object embodies a Windows PowerShell execution environment. An example is $psISE.CurrentPowerShellTab.

Methods

Properties

See Also

- The PowerShellTabCollection Object

- Windows PowerShell ISE Object Model Reference

- The ISE object hierarchy

- The Windows PowerShell ISE Scripting Object Model

The PowerShellTabCollection Object

The PowerShellTab collection object is a collection of PowerShellTab objects. It is an instance of Microsoft.PowerShell.Host.ISE.PowerShellTabs class. An example is the $psISE.PowerShellTabs object.

Methods

See Also

- The PowerShellTab Object

- Windows PowerShell ISE Object Model Reference

- The ISE object hierarchy

- The Windows PowerShell ISE Scripting Object Model

PowerShell.exe Console Help

Starts Windows PowerShell from the command line of another tool, such as Cmd.exe.

Syntax

Parameters

EXAMPLES

Copyright Notice

This program is licensed.

Warning: This computer program is protected by copyright law and international treaties.  Unauthorized reproduction or distribution of this program, or any portion of it, may result in severe civil and criminal penalties, and will be prosecuted to the maximum extent possible under the law.

Information in this document, including URL and other Internet Web site references, is subject to change without notice. Unless otherwise noted, the companies, organizations, products, domain names, e-mail addresses, logos, people, places, and events depicted in examples herein are fictitious. No association with any real company, organization, product, domain name, e-mail address, logo, person, place, or event is intended or should be inferred. Complying with all applicable copyright laws is the responsibility of the user. Without limiting the rights under copyright, no part of this document may be reproduced, stored in or introduced into a retrieval system, or transmitted in any form or by any means (electronic, mechanical, photocopying, recording, or otherwise), or for any purpose, without the express written permission of Microsoft Corporation.

Microsoft may have patents, patent applications, trademarks, copyrights, or other intellectual property rights covering subject matter in this document. Except as expressly provided in any written license agreement from Microsoft, the furnishing of this document does not give you any license to these patents, trademarks, copyrights, or other intellectual property.

© 2009 Microsoft Corporation. All rights reserved.

Microsoft, and Microsoft Office Word, Microsoft Office Excel, Microsoft Visual Studio, Windows 7, Windows PowerShell, Windows Server 2008, Windows Server 2003, Windows XP, Windows Vista, and MSDN are trademarks of the Microsoft group of companies.

All other trademarks are property of their respective owners.

Table of Contents

Selecting Parts of Objects (Select-Object)

about_Data_Sections

In this section

In this section

In this section

To go to a particular line of text in the Script Pane

In this section

In this section

In this section

In This Section