0% found this document useful (0 votes)
16 views15 pages

Commandlet Reference (Essential PowerShell) (Holger Schwichtenberg)

Uploaded by

rokabih488
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views15 pages

Commandlet Reference (Essential PowerShell) (Holger Schwichtenberg)

Uploaded by

rokabih488
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

A P P E N D I X A

POWERSHELL COMMANDLET
REFERENCE

This appendix contains a list of all commandlets that are part of Windows
PowerShell (WPS) 1.0, PowerShell Community Extensions Version 1.1.1
(PSCX), and www.IT-Visions.de PowerShell Extensions Version 2.0.

Commandlet Description Product/Version

Add-Content Adds content to the specified item(s). WPS 1.0


Add-DirectoryEntry Adds a directory entry to a container. www.IT-Visions.de
PowerShell
Extensions 2.0
Add-History Appends entries to the session history. WPS 1.0
Add-Member Adds a user-defined custom member WPS 1.0
to an instance of a WPS object.
Add-PSSnapin Adds one or more WPS snap-ins WPS 1.0
to the current console.
Add-User Adds a new user to a directory service. www.IT-Visions.de
PowerShell
Extensions 2.0
Clear-Content Deletes the contents of an item, such WPS 1.0
as deleting the text from a file, but
does not delete the item.
Clear-Item Deletes the contents of an item, but WPS 1.0
does not delete the item.
Clear-ItemProperty Deletes the value of a property, but WPS 1.0
it does not delete the property.
Clear-Variable Deletes the value of a variable. WPS 1.0

429
430 Appendix A PowerShell Commandlet Reference

Commandlet Description Product/Version

Close-DBConnection Closes an ADO.NET database www.IT-Visions.de


connection. PowerShell
Extensions 2.0
Compare-Object Compares two sets of objects. WPS 1.0
ConvertFrom-Base64 Converts base64 encoded string to PSCX 1.1.1
byte array.
ConvertFrom- Converts a secure string into an WPS 1.0
SecureString encrypted standard string.
Convert-Path Converts a path from a WPS path WPS 1.0
to a WPS provider path.
ConvertTo-Base64 Converts byte array or specified file PSCX 1.1.1
contents to base64 string.
ConvertTo-Html Creates an HTML page that repre- WPS 1.0
sents an object or a set of objects.
ConvertTo- Converts the line endings in the PSCX 1.1.1
MacOs9LineEnding specified file to Mac OS9 and
earlier style line endings \r.
ConvertTo- Converts encrypted standard strings WPS 1.0
SecureString to secure strings. It can also convert
plain text to secure strings. It is used
with ConvertFrom-SecureString
and Read-Host.
ConvertTo- Converts the line endings in the PSCX 1.1.1
UnixLineEnding specified file to UNIX line endings \n.
ConvertTo- Converts the line endings in the PSCX 1.1.1
WindowsLineEnding specified file to Windows line
endings \r\n.
Convert-Xml Performs XSLT transforms on the PSCX 1.1.1
specified XML file or XmlDocument.
Copy-Item Copies an item from one location WPS 1.0
to another within a namespace.
Copy-ItemProperty Copies a property and value from a WPS 1.0
specified location to another location.
Disconnect- Disconnects a specific remote desktop PSCX 1.1.1
TerminalSession session on a system running Terminal
Services/Remote Desktop.
Appendix A PowerShell Commandlet Reference 431

Commandlet Description Product/Version

A. POWERSHELL COMMANDLET REFERENCE


Export-Alias Exports information about currently WPS 1.0
defined aliases to a file.
Export-Bitmap Exports bitmap objects to various PSCX 1.1.1
formats.
Export-Clixml Creates an XML-based represen- WPS 1.0
tation of an object or objects and
stores it in a file.
Export-Console Exports the configuration of the WPS 1.0
current console to a file so that you
can reuse or share it.
Export-Csv Creates a comma-separated values WPS 1.0
(CSV) file that represents the input
objects.
ForEach-Object Performs an operation against each WPS 1.0
of a set of input objects.
Format-Byte Displays numbers in multiples of PSCX 1.1.1
byte units.
Format-Custom Uses a customized view to format WPS 1.0
the output.
Format-Hex Displays the contents of files or PSCX 1.1.1
byte streams in hex format and
optionally ASCII.
Format-List Formats the output as a list of WPS 1.0
properties in which each property
appears on a new line.
Format-Table Formats the output as a table. WPS 1.0
Format-Wide Formats objects as a wide table WPS 1.0
that displays only one property
of each object.
Format-Xml Pretty print for XML files and PSCX 1.1.1
XmlDocument objects.
Get-Acl Gets the security descriptor for a WPS 1.0
resource, such as a file or registry key.
Get-ADObject Search for objects in the Active PSCX 1.1.1
Directory/Global Catalog.
432 Appendix A PowerShell Commandlet Reference

Commandlet Description Product/Version

Get-Alias Gets the aliases for the current session. WPS 1.0
Get-
AuthenticodeSignature Gets information about the Authenti- WPS 1.0
code signature in a file.
Get-BIOS Gets information about the BIOS on www.IT-Visions.de
a local or remote computer PowerShell
Extensions 2.0
Get-CDRomdrive Gets information about the CD-ROM www.IT-Visions.de
drives on a local or remote computer PowerShell
Extensions 2.0
Get-ChildItem Gets the items and child items in one WPS 1.0
or more specified locations.
Get-Clipboard Gets data from the clipboard. PSCX 1.1.1
Get-Command Gets basic information about cmdlets WPS 1.0
and about other elements of WPS
commands.
Get-ComputerInfo Gets information about the local www.IT-Visions.de
computer. PowerShell
Extensions 2.0
Get-Computername Gets the name of the local computer. www.IT-Visions.de
PowerShell
Extensions 2.0
Get-Content Gets the content of the item at the WPS 1.0
specified location.
Get-Credential Gets a credential object based on a WPS 1.0
username and password.
Get-Culture Gets information about the regional WPS 1.0
settings on a computer.
Get-CurrentUser Gets information about the current www.IT-Visions.de
user. PowerShell
Extensions 2.0
Get-Date Gets the current date and time. WPS 1.0
Get-DbConnection Opes a database connection. www.IT-Visions.de
PowerShell
Extensions 2.0
Appendix A PowerShell Commandlet Reference 433

Commandlet Description Product/Version

A. POWERSHELL COMMANDLET REFERENCE


Get-DbRow Gets a single row from a database www.IT-Visions.de
table. PowerShell
Extensions 2.0
Get-DbTable Gets a database table. www.IT-Visions.de
PowerShell
Extensions 2.0
Get-DhcpServer Gets a list of authorized DHCP PSCX 1.1.1
servers.
Get-DirectoryChildren Gets the child items of a directory www.IT-Visions.de
service container. PowerShell
Extensions 2.0
Get-DirectoryEntry Gets a single entry in a directory www.IT-Visions.de
service. PowerShell
Extensions 2.0
Get-DirectoryValue Gets a value from an entry in a www.IT-Visions.de
directory service. PowerShell
Extensions 2.0
Get-Disk Gets objects about all disks on a www.IT-Visions.de
local or remote computer. PowerShell
Extensions 2.0
Get-DomainController Gets a list of available domain PSCX 1.1.1
controllers in the current forest/
domain.
Get-EventLog Gets information about local WPS 1.0
event logs or the entries stored in
those event logs.
Get-ExecutionPolicy Gets the current execution policy WPS 1.0
for the shell.
Get-ExportedType Displays public types for a given PSCX 1.1.1
AssemblyName by loading the
associated assembly into a
reflection-only context and
dumping all publicly accessible
Type objects to the pipeline.
Get-FileVersionInfo Gets a FileVersionInfo object PSCX 1.1.1
for the specified path.
434 Appendix A PowerShell Commandlet Reference

Commandlet Description Product/Version

Get-ForegroundWindow Returns the hWnd or handle of the PSCX 1.1.1


window in the foreground on the
current desktop. See also Set-
ForegroundWindow.
Get-Hash Gets the hash value for the specified PSCX 1.1.1
file or byte array via the pipeline.
Get-Help Displays information about WPS WPS 1.0
cmdlets and concepts.
Get-History Gets a list of the commands entered WPS 1.0
during the current session.
Get-Host Gets a reference to the current WPS 1.0
console host object. Displays WPS
version and regional information by
default.
Get-Item Gets the item at the specified WPS 1.0
location.
Get-ItemProperty Retrieves the properties of a WPS 1.0
specified item.
Get-ITVisions Displays information about www.IT-
this extension and checks for Visions.de
updates using a web service. PowerShell
Extensions 2.0
Get-Keyboard Gets information about the key- www.IT-
board on a local or remote computer. Visions.de
PowerShell
Extensions 2.0
Get-Location Gets information about the current WPS 1.0
working location.
Get-Member Gets information about objects or WPS 1.0
collections of objects.
Get-MemoryDevice Gets information about the RAM on www.IT-
a local or remote computer. Visions.de
PowerShell
Extensions 2.0
Appendix A PowerShell Commandlet Reference 435

Commandlet Description Product/Version

A. POWERSHELL COMMANDLET REFERENCE


Get-Metadata Gets metadata about the objects www.IT-Visions.de
in the pipeline. PowerShell
Extensions 2.0
Get-MountPoint Returns all mount points defined for PSCX 1.1.1
a specific root path.
Get-Networkadapter Gets objects about all network adapters www.IT-Visions.de
on a local or remote computer. PowerShell
Extensions 2.0
Get-PEHeader Gets the Portable Header information PSCX 1.1.1
from an executable file.
Get-PfxCertificate Gets information about PFX certificate WPS 1.0
files on the computer.
Get-PipelineInfo Gets type information about the objects www.IT-Visions.de
in the pipeline. PowerShell
Extensions 2.0
Get-PointingDevice Gets objects about mouse devices on a www.IT-Visions.de
local or remote computer. PowerShell
Extensions 2.0
Get-Privilege Lists privileges held by the session and PSCX 1.1.1
their current status.
Get-Process Gets the processes that are running on WPS 1.0
the local computer.
Get-Processor Gets objects about all processors on a www.IT-Visions.de
local or remote computer PowerShell
Extensions 2.0
Get-PSDrive Gets information about WPS drives. WPS 1.0
Get-PSProvider Gets information about the specified WPS 1.0
WPS provider.
Get-PSSnapin Gets the WPS snap-ins on the computer. WPS 1.0
Get-PSSnapinHelp Generates an XML file containing all PSCX 1.1.1
documentation data.
Get-Random Returns a random number or a byte PSCX 1.1.1
array.
Get-ReparsePoint Gets NTFS reparse point data. PSCX 1.1.1
Get-Service Gets the services on the local WPS 1.0
computer.
436 Appendix A PowerShell Commandlet Reference

Commandlet Description Product/Version

Get-ShortPath Gets the short, 8.3 name for the PSCX 1.1.1
given path.
Get-SoundDevice Gets objects about all sound devices on www.IT-Visions.de
a local or remote computer. PowerShell
Extensions 2.0
Get-TabExpansion Gets matching tab expansions. PSCX 1.1.1
Get-Tapedrive Gets objects about all tape drives www.IT-Visions.de
on a local or remote computer. PowerShell
Extensions 2.0
Get-TerminalSession Gets information on terminal services PSCX 1.1.1
sessions.
Get-TraceSource Gets the WPS components that are WPS 1.0
instrumented for tracing.
Get-UICulture Gets information about the current WPS 1.0
user interface culture for WPS.
Get-Unique Returns the unique items from a WPS 1.0
sorted list.
Get-USBController Gets objects about all USB controllers www.IT-Visions.de
on a local or remote computer. PowerShell
Extensions 2.0
Get-Variable Gets the variables in the current WPS 1.0
console.
Get-Videocontroller Gets objects about all video controllers www.IT-Visions.de
on a local or remote computer. PowerShell
Extensions 2.0
Get-WmiObject Gets instances of WMI classes or WPS 1.0
information about available classes.
Group-Object Groups objects that contain the same WPS 1.0
value for specified properties.
Import-Alias Imports an alias list from a file. WPS 1.0
Import-Bitmap Loads bitmap files. PSCX 1.1.1
Import-Clixml Imports a CLIXML file and creates WPS 1.0
corresponding objects within WPS.
Import-Csv Imports CSV files in the format WPS 1.0
produced by the Export-CSV cmdlet
and returns objects that correspond
to the objects represented in that CSV file.
Appendix A PowerShell Commandlet Reference 437

Commandlet Description Product/Version

A. POWERSHELL COMMANDLET REFERENCE


Invoke-DbCommand Invokes a command in a database. www.IT-Visions.de
PowerShell
Extensions 2.0
Invoke- Runs a WPS expression that is WPS 1.0
Expression provided in the form of a string.
Invoke-History Runs commands from the session WPS 1.0
history.
Invoke-Item Invokes the provider-specific default WPS 1.0
action on the specified item.
Invoke- Invokes a command in a database that
ScalarDbCommand returns a single value. www.IT-Visions.de
PowerShell
Extensions 2.0
Join-Path Combines a path and child path into WPS 1.0
a single path. The provider supplies
the path delimiters.
Join-String Joins an array of strings into a single PSCX 1.1.1
string.
Measure-Command Measures the time it takes to run script WPS 1.0
blocks and cmdlets.
Measure-Object Measures characteristics of objects and WPS 1.0
their properties.
Move-Item Moves an item from one location to WPS 1.0
another.
Move- Moves a property from one location to WPS 1.0
ItemProperty another.
New-Alias Creates a new alias. WPS 1.0
New-Hardlink Creates file system hard links. The PSCX 1.1.1
hardlink and the target must reside on
the same NTFS volume.
New-Item Creates a new item in a namespace. WPS 1.0
New- Sets a new property of an item at a WPS 1.0
ItemProperty location.
New-Junction Creates NTFS directory junctions. PSCX 1.1.1
New-Object Creates an instance of a .NET or WPS 1.0
COM object.
438 Appendix A PowerShell Commandlet Reference

Commandlet Description Product/Version

New-PSDrive Installs a new WPS drive. WPS 1.0


New-Service Creates a new entry for a Windows service WPS 1.0
in the registry and the service database.
New-Shortcut Creates shell shortcuts. PSCX 1.1.1
New-Symlink Creates file system symbolic links. Requires PSCX 1.1.1
Microsoft Windows Vista or later.
New-TimeSpan Creates a TimeSpan object. WPS 1.0
New-Variable Creates a new variable. WPS 1.0
Out-Clipboard Formats text via Out-String before placing PSCX 1.1.1
in the clipboard.
Out-Default Sends the output to the default formatter and WPS 1.0
the default output cmdlet. This cmdlet has no
effect on the formatting or output. It is a
placeholder that lets you write your own
Out-Default function or cmdlet.
Out-File Sends output to a file. WPS 1.0
Out-Host Sends output to the command line. WPS 1.0
Out-Null Deletes output instead of sending it to WPS 1.0
the console.
Out-Printer Sends output to a printer. WPS 1.0
Out-String Sends objects to the host as a series of strings. WPS 1.0
Ping-Host Sends ICMP echo requests to network hosts. PSCX 1.1.1
Pop-Location Changes the current location to the location WPS 1.0
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.
Push-Location Pushes the current location onto the stack. WPS 1.0
Read-Host Reads a line of input from the console. WPS 1.0
Remove- Removes a directory entry from a www.IT-Visions.de
DirectoryEntry directory service. PowerShell
Extensions 2.0
Remove-Item Deletes the specified items. WPS 1.0
Remove- Deletes the property and its value from WPS 1.0
ItemProperty an item.
Appendix A PowerShell Commandlet Reference 439

Commandlet Description Product/Version

A. POWERSHELL COMMANDLET REFERENCE


Remove-MountPoint Removes a mount point, dismounting PSCX 1.1.1
the current media if any. If used against
the root of a fixed drive, removes the
drive letter assignment.
Remove-PSDrive Removes a WPS drive from its location. WPS 1.0
Remove-PSSnapin Removes WPS snap-ins from the WPS 1.0
current console.
Remove- Removes NTFS reparse junctions and PSCX 1.1.1
ReparsePoint symbolic links.
Remove-Variable Deletes a variable and its value. WPS 1.0
Rename-Item Renames an item in a WPS provider WPS 1.0
namespace.
Rename- Renames a property of an item. WPS 1.0
ItemProperty
Resize-Bitmap Resizes bitmaps. PSCX 1.1.1
Resolve-Assembly Resolves and optionally imports assemblies PSCX 1.1.1
by partial name with optional version.
Resolve-Host Resolves host names to IP addresses. PSCX 1.1.1
Resolve-Path Resolves the wildcard characters in a WPS 1.0
path and displays the path contents.
Restart-Service Stops and then starts one or more WPS 1.0
services.
Resume-Service Resumes one or more suspended WPS 1.0
(paused) services.
Select-Object Selects specified properties of an object WPS 1.0
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.
Select-String Identifies patterns in strings. WPS 1.0
Select-Xml Selects elements in XML files and PSCX 1.1.1
XmlDocument objects with XPath
expressions.
Send-SmtpMail Sends e-mail via specified SMTP server PSCX 1.1.1
to specified recipients.
440 Appendix A PowerShell Commandlet Reference

Commandlet Description Product/Version

Set-Acl Changes the security descriptor WPS 1.0


of a specified resource, such as a
file or a registry key.
Set-Alias Creates or changes an alias WPS 1.0
(alternate name) for a cmdlet or
other command element in the
current WPS session.
Set- Uses an Authenticode signature to WPS 1.0
AuthenticodeSignature sign a WPS script or other file.

Set-Clipboard Puts the specified object into the PSCX 1.1.1


system clipboard.
Set-Content Writes or replaces the content in WPS 1.0
an item with new content.
Set-Date Changes the system time on the WPS 1.0
computer to a time that you specify.
Set-DbTable Saves the updated data of a data www.IT-Visions.de
table. PowerShell
Extensions 2.0
Set-DirectoryValue Sets a value in a directory entry. www.IT-Visions.de
PowerShell
Extensions 2.0
Set- Changes the user preference for WPS 1.0
ExecutionPolicy the execution policy of the shell.
Set-FileTime Sets a file or folder’s created and PSCX 1.1.1
last accessed/write times.
Set-ForegroundWindow Given an hWnd or window handle, PSCX 1.1.1
brings that window to the fore-
ground. Useful for restoring a
window to uppermost after an
application that seizes the fore-
ground is invoked. See also
Get-ForegroundWindow.
Set-Item Changes the value of an item to WPS 1.0
the value specified in the command.
Set-ItemProperty Sets the value of a property at the WPS 1.0
specified location.
Appendix A PowerShell Commandlet Reference 441

Commandlet Description Product/Version

A. POWERSHELL COMMANDLET REFERENCE


Set-Location Sets the current working location WPS 1.0
to a specified location.
Set-Privilege Adjusts privileges held by the PSCX 1.1.1
session.
Set-PSDebug Turns script debugging features on WPS 1.0
and off, sets the trace level and
toggles strict mode.
Set-Service Changes the display name, descrip- WPS 1.0
tion, or starting mode of a service.
Set-TraceSource Configures, starts, and stops a trace WPS 1.0
of WPS components.
Set-Variable Sets the value of a variable. Creates WPS 1.0
the variable if one with the requested
name does not exist.
Set-VolumeLabel Modifies the label shown in Windows PSCX 1.1.1
Explorer for a particular disk volume.
Sort-Object Sorts objects by property values. WPS 1.0
Split-Path Returns the specified part of a path. WPS 1.0
Split-String Splits a single string into an array PSCX 1.1.1
of strings.
Start-Process Starts a new process. PSCX 1.1.1
Start-Service Starts one or more stopped services. WPS 1.0
Start-Sleep Suspends shell, script, or runspace WPS 1.0
activity for the specified period of
time.
Start-TabExpansion Initializes the tab expansion caches. PSCX 1.1.1
Start-Transcript Creates a record of all or part of a WPS 1.0
WPS session in a text file.
Stop-Process Stops one or more running processes. WPS 1.0
Stop-Service Stops one or more running services. WPS 1.0
Stop-TerminalSession Logs off a specific remote desktop PSCX 1.1.1
session on a system running Terminal
Services/Remote Desktop.
Stop-Transcript Stops a transcript. WPS 1.0
442 Appendix A PowerShell Commandlet Reference

Commandlet Description Product/Version

Suspend-Service Suspends (pauses) one or more WPS 1.0


running services.
Tee-Object Pipes object input to a file or variable, WPS 1.0
and then passes the input along the
pipeline.
Test-Assembly Tests whether the specified file is a PSCX 1.1.1
.NET assembly.
Test-DbConnection Tests the availability of a database. www.IT-Visions.de
PowerShell
Extensions 2.0
Test-Path Determines whether all elements of a WPS 1.0
path exist.
Test-Xml Tests for well formedness and optionally PSCX 1.1.1
validates against XML Schema.
Trace-Command Configures and starts a trace of the WPS 1.0
specified expression or command.
Update-FormatData Updates and appends format data files. WPS 1.0
Update-TypeData Updates the current extended type WPS 1.0
configuration by reloading the *.types.
ps1xml files into memory.
Where-Object Creates a filter that controls which WPS 1.0
objects will be passed along a command
pipeline.
Write-BZip2 Creates BZIP2 format archive files from PSCX 1.1.1
pipeline or parameter input.
Write-Clipboard Writes objects to the clipboard using PSCX 1.1.1
their string representation, bypassing
the default WPS formatting.
Write-Debug Writes a debug message to the host WPS 1.0
display.
Write-Error Writes an object to the error pipeline. WPS 1.0
Write-GZip Creates GNU Zip (Gzip) format files PSCX 1.1.1
from pipeline or parameter input.
Write-Host Displays objects by using the host WPS 1.0
user interface.
Appendix A PowerShell Commandlet Reference 443

Commandlet Description Product/Version

A. POWERSHELL COMMANDLET REFERENCE


Write-Output Writes objects to the success pipeline. WPS 1.0
Write-Progress Displays a progress bar within a WPS WPS 1.0
command window.
Write-Tar Creates Tape Archive (TAR) format files PSCX 1.1.1
from pipeline or parameter input.
Write-Verbose Writes a string to the verbose display of WPS 1.0
the host.
Write-Warning Writes a warning message. WPS 1.0
Write-Zip Creates Zip format archive files from PSCX 1.1.1
pipeline or parameter input.

You might also like