Changes

Jump to: navigation, search

Windows PowerShell 1.0 Commands and Aliases

18,371 bytes added, 18:38, 12 November 2008
New page: Windows PowerShell contains a wide range of built-in commands which which can be used either in the interactive shell environment, or within cmdlet scripts. In addition, each command also...
Windows PowerShell contains a wide range of built-in commands which which can be used either in the interactive shell environment, or within cmdlet scripts. In addition, each command also has a pre-configured alias which typically shortens the amount of typing necessary to invoke a command, and often provides access to a command via a more familiar name. For example, the ''Get-ChildItem'' command for listing the contents of a directory may also be executed using the more familiar ''dir'' alias.

In this chapter of [[Windows PowerShell 1.0 Essentials]] a summary of each command is provided, together with a table of alias to command relationships.

== PowerShell 1.0 Command Summary ==

The following table lists the different commands provided with Windows PowerShell 1.0:

<table border="1" cellpadding="5" cellspacing="0" id="E3B" style="border-collapse: collapse; border-color:#cccccc; border-style: solid; border-width: 1px; margin-bottom:20px">
<tr bgcolor="#cccccc" style="color:black" valign="top">
<th>
<p>Command</p>
</th>
<th>
<p>Type</p>
</th>
<th>
<p>Description</p>
</th>
</tr>
<tr><td>Get-Command</td><td>Cmdlet</td><td>Get basic information about cmdlets and other elements of Windows PowerShell commands.</td></tr>
<tr bgcolor="#e9e9e6"><td>Get-Help</td><td>Cmdlet</td><td>Display information about Windows PowerShell cmdlets.</td></tr>
<tr><td>Get-History</td><td>Cmdlet</td><td>Get a list of the previous commands entered during the current session.</td></tr>
<tr bgcolor="#e9e9e6"><td>Invoke-History</td><td>Cmdlet</td><td>Run selected commands from the session history.</td></tr>
<tr><td>Add-History</td><td>Cmdlet</td><td>Append entries to the session history.</td></tr>
<tr bgcolor="#e9e9e6"><td>ForEach-Object</td><td>Cmdlet</td><td>Perform an operation against each of a set of input objects.</td></tr>
<tr><td>Where-Object</td><td>Cmdlet</td><td>Create a filter that controls which objects will be passed along a command pipeline.</td></tr>
<tr bgcolor="#e9e9e6"><td>Set-PSDebug</td><td>Cmdlet</td><td>Turns script debugging features on and off, sets the trace level and toggles strict mode.</td></tr>
<tr><td>Add-PSSnapin</td><td>Cmdlet</td><td>Add one or more Windows PowerShell snap-ins to the current console.</td></tr>
<tr bgcolor="#e9e9e6"><td>Remove-PSSnapin</td><td>Cmdlet</td><td>Remove Windows PowerShell snap-ins from the current console.</td></tr>
<tr><td>Get-PSSnapin</td><td>Cmdlet</td><td>Get the Windows PowerShell snap-ins on the computer.</td></tr>
<tr bgcolor="#e9e9e6"><td>Export-Console</td><td>Cmdlet</td><td>Export the configuration of the current console to a file so that you can reuse or share it.</td></tr>
<tr><td>Start-Transcript</td><td>Cmdlet</td><td>Create a record of all or part of a Windows PowerShell session in a text file.</td></tr>
<tr bgcolor="#e9e9e6"><td>Stop-Transcript</td><td>Cmdlet</td><td>Stop a transcript.</td></tr>
<tr><td>Add-Content</td><td>Cmdlet</td><td>Add content to the specified item(s).</td></tr>
<tr bgcolor="#e9e9e6"><td>Clear-Content</td><td>Cmdlet</td><td>Delete the contents of a item, such as deleting the text from a file, but does not delete the item.</td></tr>
<tr><td>Clear-ItemProperty</td><td>Cmdlet</td><td>Delete the value of a property but it does not delete the property.</td></tr>
<tr bgcolor="#e9e9e6"><td>Join-Path</td><td>Cmdlet</td><td>Combines a path and child-path into a single path. The provider supplies the path delimiters.</td></tr>
<tr><td>Convert-Path</td><td>Cmdlet</td><td>Convert a path from a Windows PowerShell path to a Windows PowerShell provider path.</td></tr>
<tr bgcolor="#e9e9e6"><td>Copy-ItemProperty</td><td>Cmdlet</td><td>Copy a property and value from a specified location to another location.</td></tr>
<tr><td>Get-EventLog</td><td>Cmdlet</td><td>Get information about local event logs or the entries stored in those event logs.</td></tr>
<tr bgcolor="#e9e9e6"><td>Get-ChildItem</td><td>Cmdlet</td><td>Get the items and child items in one or more specified locations.</td></tr>
<tr><td>Get-Content</td><td>Cmdlet</td><td>Get the content of the item at the specified location.</td></tr>
<tr bgcolor="#e9e9e6"><td>Get-ItemProperty</td><td>Cmdlet</td><td>Retrieve the properties of a specified item.</td></tr>
<tr><td>Get-WmiObject</td><td>Cmdlet</td><td>Get instances of WMI classes or information about available classes.</td></tr>
<tr bgcolor="#e9e9e6"><td>Move-ItemProperty</td><td>Cmdlet</td><td>Move a property from one location to another.</td></tr>
<tr><td>Get-Location</td><td>Cmdlet</td><td>Get information about the current working location.</td></tr>
<tr bgcolor="#e9e9e6"><td>Set-Location</td><td>Cmdlet</td><td>Set the current working location to a specified location.</td></tr>
<tr><td>Push-Location</td><td>Cmdlet</td><td>Push the current location onto the stack.</td></tr>
<tr bgcolor="#e9e9e6"><td>Pop-Location</td><td>Cmdlet</td><td>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 Push-Location.</td></tr>
<tr><td>New-PSDrive</td><td>Cmdlet</td><td>Install a new Windows PowerShell drive.</td></tr>
<tr bgcolor="#e9e9e6"><td>Remove-PSDrive</td><td>Cmdlet</td><td>Remove a Windows PowerShell drive from its location.</td></tr>
<tr><td>Get-PSDrive</td><td>Cmdlet</td><td>Get information about Windows PowerShell drives.</td></tr>
<tr bgcolor="#e9e9e6"><td>Get-Item</td><td>Cmdlet</td><td>Get the item at the specified location.</td></tr>
<tr><td>New-Item</td><td>Cmdlet</td><td>Create a new item in a namespace.</td></tr>
<tr bgcolor="#e9e9e6"><td>Set-Item</td><td>Cmdlet</td><td>Change the value of an item to the value specified in the command.</td></tr>
<tr><td>Remove-Item</td><td>Cmdlet</td><td>Delete the specified items.</td></tr>
<tr bgcolor="#e9e9e6"><td>Move-Item</td><td>Cmdlet</td><td>Move an item from one location to another.</td></tr>
<tr><td>Rename-Item</td><td>Cmdlet</td><td>Rename an item in a Windows PowerShell provider namespace.</td></tr>
<tr bgcolor="#e9e9e6"><td>Copy-Item</td><td>Cmdlet</td><td>Copy an item from one location to another within a namespace.</td></tr>
<tr><td>Clear-Item</td><td>Cmdlet</td><td>Delete the contents of an item, but does not delete the item.</td></tr>
<tr bgcolor="#e9e9e6"><td>Invoke-Item</td><td>Cmdlet</td><td>Invoke the provider-specific default action on the specified item.</td></tr>
<tr><td>Get-PSProvider</td><td>Cmdlet</td><td>Get information about the specified Windows PowerShell provider.</td></tr>
<tr bgcolor="#e9e9e6"><td>New-ItemProperty</td><td>Cmdlet</td><td>Set a new property of an item at a location.</td></tr>
<tr><td>Split-Path</td><td>Cmdlet</td><td>Return the specified part of a path.</td></tr>
<tr bgcolor="#e9e9e6"><td>Test-Path</td><td>Cmdlet</td><td>Determine whether all elements of a path exist.</td></tr>
<tr><td>Get-Process</td><td>Cmdlet</td><td>Get the processes that are running on the local computer.</td></tr>
<tr bgcolor="#e9e9e6"><td>Stop-Process</td><td>Cmdlet</td><td>Stop one or more running processes.</td></tr>
<tr><td>Remove-ItemProperty</td><td>Cmdlet</td><td>Delete the property and its value from an item.</td></tr>
<tr bgcolor="#e9e9e6"><td>Rename-ItemProperty</td><td>Cmdlet</td><td>Rename a property of an item.</td></tr>
<tr><td>Resolve-Path</td><td>Cmdlet</td><td>Resolve the wildcard characters in a path and displays the path contents.</td></tr>
<tr bgcolor="#e9e9e6"><td>Get-Service</td><td>Cmdlet</td><td>Get the services on the local computer.</td></tr>
<tr><td>Stop-Service</td><td>Cmdlet</td><td>Stop one or more running services.</td></tr>
<tr bgcolor="#e9e9e6"><td>Start-Service</td><td>Cmdlet</td><td>Start one or more stopped services.</td></tr>
<tr><td>Suspend-Service</td><td>Cmdlet</td><td>Suspend (pauses) one or more running services.</td></tr>
<tr bgcolor="#e9e9e6"><td>Resume-Service</td><td>Cmdlet</td><td>Resumes one or more suspended (paused) services.</td></tr>
<tr><td>Restart-Service</td><td>Cmdlet</td><td>Stop and then start one or more services.</td></tr>
<tr bgcolor="#e9e9e6"><td>Set-Service</td><td>Cmdlet</td><td>Change the display name, description, or starting mode of a service.</td></tr>
<tr><td>New-Service</td><td>Cmdlet</td><td>Create a new entry for a Windows Service in the registry and the Service Database.</td></tr>
<tr bgcolor="#e9e9e6"><td>Set-Content</td><td>Cmdlet</td><td>Write or replaces the content in an item with new content.</td></tr>
<tr><td>Set-ItemProperty</td><td>Cmdlet</td><td>Set the value of a property at the specified location.</td></tr>
<tr bgcolor="#e9e9e6"><td>Get-Acl</td><td>Cmdlet</td><td>Get the security descriptor for a resource, such as a file or registry key.</td></tr>
<tr><td>Set-Acl</td><td>Cmdlet</td><td>Change the security descriptor of a specified resource, such as a file or a registry key.</td></tr>
<tr bgcolor="#e9e9e6"><td>Get-PfxCertificate</td><td>Cmdlet</td><td>Get information about .pfx certificate files on the computer.</td></tr>
<tr><td>Get-Credential</td><td>Cmdlet</td><td>Get a credential object based on a user name and password.</td></tr>
<tr bgcolor="#e9e9e6"><td>Get-ExecutionPolicy</td><td>Cmdlet</td><td>Get the current execution policy for the shell.</td></tr>
<tr><td>Set-ExecutionPolicy</td><td>Cmdlet</td><td>Change the user preference for the execution policy of the shell.</td></tr>
<tr bgcolor="#e9e9e6"><td>Get-AuthenticodeSignature</td><td>Cmdlet</td><td>Get information about the Authenticode signature in a file.</td></tr>
<tr><td>Set-AuthenticodeSignature</td><td>Cmdlet</td><td>Use an authenticode signature to sign a Windows PowerShell script or other file.</td></tr>
<tr bgcolor="#e9e9e6"><td>ConvertFrom-SecureString</td><td>Cmdlet</td><td>Convert a secure string into an encrypted standard string.</td></tr>
<tr><td>ConvertTo-SecureString</td><td>Cmdlet</td><td>Convert encrypted standard strings to secure strings. It can also convert plain text to secure strings. It is used with ConvertFrom-SecureString and Read-Host.</td></tr>
<tr bgcolor="#e9e9e6"><td>Format-List</td><td>Cmdlet</td><td>Format the output as a list of properties in which each property appears on a new line.</td></tr>
<tr><td>Format-Custom</td><td>Cmdlet</td><td>Use a customized view to format the output.</td></tr>
<tr bgcolor="#e9e9e6"><td>Format-Table</td><td>Cmdlet</td><td>Format the output as a table.</td></tr>
<tr><td>Format-Wide</td><td>Cmdlet</td><td>Format objects as a wide table that displays only one property of each object.</td></tr>
<tr bgcolor="#e9e9e6"><td>Out-Null</td><td>Cmdlet</td><td>Delete output instead of sending it to the console.</td></tr>
<tr><td>Out-Default</td><td>Cmdlet</td><td>Send the output to the default formatter and the default output cmdlet. Has no effect on the formatting or output and is provided as a placeholder that lets you write your own Out-Default function or cmdlet.</td></tr>
<tr bgcolor="#e9e9e6"><td>Out-Host</td><td>Cmdlet</td><td>Send output to the command line.</td></tr>
<tr><td>Out-File</td><td>Cmdlet</td><td>Send output to a file.</td></tr>
<tr bgcolor="#e9e9e6"><td>Out-Printer</td><td>Cmdlet</td><td>Send output to a printer.</td></tr>
<tr><td>Out-String</td><td>Cmdlet</td><td>Send objects to the host as a series of strings.</td></tr>
<tr bgcolor="#e9e9e6"><td>Add-Member</td><td>Cmdlet</td><td>Add a user-defined custom member to an instance of a Windows PowerShell object.</td></tr>
<tr><td>Compare-Object</td><td>Cmdlet</td><td>Compare two sets of objects.</td></tr>
<tr bgcolor="#e9e9e6"><td>ConvertTo-Html</td><td>Cmdlet</td><td>Create an HTML page that represents an object or a set of objects.</td></tr>
<tr><td>Export-Csv</td><td>Cmdlet</td><td>Create a comma-separated values (CSV) file that represents the input objects.</td></tr>
<tr bgcolor="#e9e9e6"><td>Import-Csv</td><td>Cmdlet</td><td>Imports comma-separated value (CSV) files in the format produced by the Export-CSV cmdlet and returns objects that correspond to the objects represented in that CSV file.</td></tr>
<tr><td>Export-Alias</td><td>Cmdlet</td><td>Export information about currently-defined aliases to a file.</td></tr>
<tr bgcolor="#e9e9e6"><td>Invoke-Expression</td><td>Cmdlet</td><td>Run a Windows PowerShell expression that is provided in the form of a string.</td></tr>
<tr><td>Get-Alias</td><td>Cmdlet</td><td>Get the aliases for the current session.</td></tr>
<tr bgcolor="#e9e9e6"><td>Get-Culture</td><td>Cmdlet</td><td>Get information about the regional settings on a computer.</td></tr>
<tr><td>Get-Date</td><td>Cmdlet</td><td>Get the current date and time.</td></tr>
<tr bgcolor="#e9e9e6"><td>Get-Host</td><td>Cmdlet</td><td>Get a reference to the current console host object. Display Windows Powershell version and regional information by default.</td></tr>
<tr><td>Get-Member</td><td>Cmdlet</td><td>Get information about objects or collections of objects.</td></tr>
<tr bgcolor="#e9e9e6"><td>Get-UICulture</td><td>Cmdlet</td><td>Get information about the current user interface culture for Windows PowerShell.</td></tr>
<tr><td>Get-Unique</td><td>Cmdlet</td><td>Return the unique items from a sorted list.</td></tr>
<tr bgcolor="#e9e9e6"><td>Import-Alias</td><td>Cmdlet</td><td>Import an alias list from a file.</td></tr>
<tr><td>Select-String</td><td>Cmdlet</td><td>Identify patterns in strings.</td></tr>
<tr bgcolor="#e9e9e6"><td>Measure-Object</td><td>Cmdlet</td><td>Measure characteristics of objects and their properties.</td></tr>
<tr><td>New-Alias</td><td>Cmdlet</td><td>Create a new alias.</td></tr>
<tr bgcolor="#e9e9e6"><td>New-TimeSpan</td><td>Cmdlet</td><td>Create a TimeSpan object.</td></tr>
<tr><td>Read-Host</td><td>Cmdlet</td><td>Read a line of input from the console.</td></tr>
<tr bgcolor="#e9e9e6"><td>Set-Alias</td><td>Cmdlet</td><td>Create or changes an alias (alternate name) for a cmdlet or other command element in the current Windows PowerShell session.</td></tr>
<tr><td>Set-Date</td><td>Cmdlet</td><td>Change the system time on the computer to a time that you specify.</td></tr>
<tr bgcolor="#e9e9e6"><td>Start-Sleep</td><td>Cmdlet</td><td>Suspend shell, script, or runspace activity for the specified period of time.</td></tr>
<tr><td>Tee-Object</td><td>Cmdlet</td><td>Pipe object input to a file or variable, then passes the input along the pipeline.</td></tr>
<tr bgcolor="#e9e9e6"><td>Measure-Command</td><td>Cmdlet</td><td>Measure the time it takes to run script blocks and cmdlets.</td></tr>
<tr><td>Update-TypeData</td><td>Cmdlet</td><td>Update the current extended type configuration by reloading the *.types.ps1xml files into memory.</td></tr>
<tr bgcolor="#e9e9e6"><td>Update-FormatData</td><td>Cmdlet</td><td>Update and appends format data files.</td></tr>
<tr><td>Write-Host</td><td>Cmdlet</td><td>Display objects by using the host user interface</td></tr>
<tr bgcolor="#e9e9e6"><td>Write-Progress</td><td>Cmdlet</td><td>Display a progress bar within a Windows PowerShell command window.</td></tr>
<tr><td>New-Object</td><td>Cmdlet</td><td>Create an instance of a .Net or COM object.</td></tr>
<tr bgcolor="#e9e9e6"><td>Select-Object</td><td>Cmdlet</td><td> 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.</td></tr>
<tr><td>Group-Object</td><td>Cmdlet</td><td>Groups objects that contain the same value for specified properties.</td></tr>
<tr bgcolor="#e9e9e6"><td>Sort-Object</td><td>Cmdlet</td><td>Sorts objects by property values.</td></tr>
<tr><td>Get-Variable</td><td>Cmdlet</td><td>Get the variables in the current console.</td></tr>
<tr bgcolor="#e9e9e6"><td>New-Variable</td><td>Cmdlet</td><td>Create a new variable.</td></tr>
<tr><td>Set-Variable</td><td>Cmdlet</td><td>Set the value of a variable. Create the variable if one with the requested name does not exist.</td></tr>
<tr bgcolor="#e9e9e6"><td>Remove-Variable</td><td>Cmdlet</td><td>Delete a variable and its value.</td></tr>
<tr><td>Clear-Variable</td><td>Cmdlet</td><td>Delete the value of a variable.</td></tr>
<tr bgcolor="#e9e9e6"><td>Export-Clixml</td><td>Cmdlet</td><td>Create an XML-based representation of an object or objects and stores it in a file.</td></tr>
<tr><td>Import-Clixml</td><td>Cmdlet</td><td>Import a CLIXML file and creates corresponding objects within Windows PowerShell.</td></tr>
<tr bgcolor="#e9e9e6"><td>Write-Debug</td><td>Cmdlet</td><td>Write a debug message to the host display.</td></tr>
<tr><td>Write-Verbose</td><td>Cmdlet</td><td>Write a string to the verbose display of the host.</td></tr>
<tr bgcolor="#e9e9e6"><td>Write-Warning</td><td>Cmdlet</td><td>Write a warning message.</td></tr>
<tr><td>Write-Error</td><td>Cmdlet</td><td>Write an object to the error pipeline.</td></tr>
<tr bgcolor="#e9e9e6"><td>Write-Output</td><td>Cmdlet</td><td>Write objects to the success pipeline.</td></tr>
<tr><td>Get-TraceSource</td><td>Cmdlet</td><td>Get the Windows PowerShell components that are instrumented for tracing.</td></tr>
<tr bgcolor="#e9e9e6"><td>Set-TraceSource</td><td>Cmdlet</td><td>Configures, starts, and stops a trace of Windows PowerShell components.</td></tr>
<tr><td>Trace-Command</td><td>Cmdlet</td><td>The Trace-Command cmdlet configures and starts a trace of the specified expression or command.</td></tr>
<tr bgcolor="#e9e9e6"><td>Alias</td><td>Provider</td><td>Provides access to the Windows PowerShell aliases and the values that they represent.</td></tr>
<tr><td>Environment</td><td>Provider</td><td>Provides access to the Windows environment variables.</td></tr>
<tr bgcolor="#e9e9e6"><td>FileSystem</td><td>Provider</td><td>The PowerShell Provider for accessing files and directories from within the Windows PowerShell.</td></tr>
<tr><td>Function</td><td>Provider</td><td>Provides access to the functions defined in Windows PowerShell.</td></tr>
<tr bgcolor="#e9e9e6"><td>Registry</td><td>Provider</td><td>Provides access to the system registry keys and values from within Windows PowerShell.</td></tr>
<tr><td>Variable</td><td>Provider</td><td>Provides access to the Windows PowerShell variables and their values.</td></tr>
<tr bgcolor="#e9e9e6"><td>Certificate</td><td>Provider</td><td>Provides access to X509 certificate stores and certificates from within Windows PowerShell.</td></tr>
</table>

Navigation menu