Thursday, October 17, 2013

Powershell Commands quick Reference and Purpose of each Command


Use Get-Help command to get an information about cmdlet.


One of the really nice features of Windows PowerShell is the fact that it includes a very extensive help system, which just happens to be incorporated right into the shell itself. Once you know the name of a cmdlet, you can get additional information on that cmdlet by calling the Get-Help cmdlet:



Reference from the Microsoft Press book Windows PowerShell 2.0 Administrator’s Pocket Consultant by William R. Stanek.



Add-BitsFileAdds one or more files to an existing Background Intelligent Transfer Service (BITS) transfer job.
Add-ComputerAdds the local computer to a domain or workgroup.
Add-ContentAdds content to the specified items, such as adding words to a file.
Add-HistoryAppends entries to the session history.
Add-MemberAdds a user-defined custom member to an instance of a Windows PowerShell object.
Add-PSSnapinAdds one or more Windows PowerShell snap-ins to the current session.
Add-TypeAdds a Microsoft .NET Framework type (a class) to a Windows PowerShell session (PSSession).
Checkpoint-ComputerCreates a system restore point on the local computer.
Clear-ContentDeletes the contents of an item, such as deleting the text from a file, but does not delete the item.
Clear-EventLogDeletes all entries from specified event logs on the local or remote computers.
Clear-HistoryDeletes entries from the command history.
Clear-ItemDeletes the contents of an item but does not delete the item.
Clear-ItemPropertyDeletes the value of a property but does not delete the property.
Clear-VariableDeletes the value of a variable.
Compare-ObjectCompares two sets of objects.
Complete-BitsTransferCompletes a BITS transfer job.
Complete-TransactionCommits the active transaction.
Connect-WSManConnects to the Windows Remote Management (WinRM) service on a remote computer.
ConvertFrom-CSVConverts object properties in comma-separated value (CSV) format into CSV versions of the original objects.
ConvertFrom-SecureStringConverts a secure string into an encrypted standard string.
ConvertFrom-StringDataConverts a string containing one or more key/value pairs to a hash table.
Convert-PathConverts a path from a Windows PowerShell path to a PowerShell provider path.
ConvertTo-CSVConverts .NET Framework objects into a series of CSV variable-length strings.
ConvertTo-HtmlConverts .NET Framework objects into HTML that can be displayed in a Web browser.
ConvertTo-SecureStringConverts encrypted standard strings to secure strings. It can also convert plain text to secure strings. It is used with ConvertFrom-SecureString and Read-Host.
ConvertTo-XMLCreates an XML-based representation of an object.
Copy-ItemCopies an item from one location to another within a namespace.
Copy-ItemPropertyCopies a property and value from a specified location to another location.
Debug-ProcessDebugs one or more processes running on the local computer.
Disable-ComputerRestoreDisables the System Restore feature on the specified file system drive.
Disable-PSBreakpointDisables breakpoints in the current console.
Disable-PSSessionConfigurationDenies access to the session configurations on the local computer.
Disable-WSManCredSSPDisables Credential Security Service Provider (CredSSP) authentication on a client computer.
Disconnect-WSManDisconnects the client from the WinRM service on a remote computer.
Enable-ComputerRestoreEnables the System Restore feature on the specified file system drive.
Enable-PSBreakpointEnables breakpoints in the current console.
Enable-PSRemotingConfigures the computer to receive remote commands.
Enable-PSSessionConfigurationEnables session configurations on the local computer.
Enable-WSManCredSSPEnables CredSSP authentication on a client computer.
Enter-PSSessionStarts an interactive session with a remote computer.
Exit-PSSessionEnds an interactive session with a remote computer.
Export-AliasExports information about currently defined aliases to a file.
Export-ClixmlCreates an XML-based representation of an object or objects and stores it in a file.
Export-ConsoleExports the names of snap-ins in the current session to a console file.
Export-CounterTakes PerformanceCounterSampleSet objects and exports them as counter log files.
Export-CSVConverts .NET Framework objects into a series of CSV variable-length strings and saves the strings in a CSV file.
Export-FormatDataSaves formatting data from the current session in a formatting file.
Export-ModuleMemberSpecifies the module members that are exported.
Export-PSSessionImports commands from another session and saves them in a Windows PowerShell module.
ForEach-ObjectPerforms an operation against each of a set of input objects.
Format-CustomUses a customized view to format the output.
Format-ListFormats the output as a list of properties in which each property appears on a new line.
Format-TableFormats the output as a table.
Format-WideFormats objects as a wide table that displays only one property of each object.
Get-AclGets the security descriptor for a resource, such as a file or registry key.
Get-AliasGets the aliases for the current session.
Get-AppLockerFileInformationGets the AppLocker file information from a list of files or an event log.
Get-AppLockerPolicyGets the local, effective, or domain AppLocker policy.
Get-AuthenticodeSignatureGets information about the Authenticode signature in a file.
Get-BitsTransferRetrieves the associated BitsJob object for an existing BITS transfer job.
Get-ChildItemGets the items and child items in one or more specified locations.
Get-CommandGets basic information about cmdlets and other elements of Windows PowerShell commands.
Get-ComputerRestorePointGets the restore points on the local computer.
Get-ContentGets the content of the item at the specified location.
Get-CounterGets performance counter data from local and remote computers.
Get-CredentialGets a credential object based on a user name and password.
Get-CultureGets the current culture set in the operating system.
Get-DateGets the current date and time.
Get-EventGets the events in the event queue.
Get-EventLogGets the events in an event log, or a list of the event logs, on the local or remote computers.
Get-EventSubscriberGets the event subscribers in the current session.
Get-ExecutionPolicyGets the execution policies for the current session.
Get-FormatDataGets the formatting data in the current session.
Get-HelpDisplays information about Windows PowerShell commands and concepts.
Get-HistoryGets a list of the commands entered during the current session.
Get-HostGets an object that represents the current host program. Also displays Windows PowerShell version and regional information by default.
Get-HotFixGets the hotfixes that are applied to the local and remote computers.
Get-ItemGets the item at the specified location.
Get-ItemPropertyGets the properties of a specified item.
Get-JobGets Windows PowerShell background jobs that are running in the current session.
Get-LocationGets information about the current working location.
Get-MemberGets the properties and methods of objects.
Get-ModuleGets the modules that are imported or that can be imported into the current session.
Get-PfxCertificateGets information about .pfx certificate files on the computer.
Get-ProcessGets the processes that are running on the local computer or a remote computer.
Get-PSBreakpointGets the breakpoints that are set in the current session.
Get-PSCallStackDisplays the current call stack.
Get-PSDriveGets the Windows PowerShell drives in the current session.
Get-PSProviderGets information about the specified Windows PowerShell provider.
Get-PSSessionGets the Windows PSSessions in the current session.
Get-PSSessionConfigurationGets the registered session configurations on the computer.
Get-PSSnapinGets the Windows PowerShell snap-ins on the computer.
Get-RandomGets a random number or selects objects randomly from a collection.
Get-ServiceGets the services on a local or remote computer.
Get-TraceSourceGets the Windows PowerShell components that are instrumented for tracing.
Get-TransactionGets the current (active) transaction.
Get-TroubleshootingPackGets information about a troubleshooting pack and can generate an answer file.
Get-UICultureGets the current user interface (UI) culture settings in the operating system.
Get-UniqueReturns the unique items from a sorted list.
Get-VariableGets the variables in the current console.
Get-WinEventGets events from event logs and event tracing log files on local and remote computers.
Get-WmiObjectGets instances of Windows Management Instrumentation (WMI) classes or information about the available classes.
Get-WSManCredSSPGets the CredSSP-related configuration for the client.
Get-WSManInstanceDisplays management information for a resource instance specified by a Uniform Resource Identifier (URI).
Group-ObjectGroups objects that contain the same value for specified properties.
Import-AliasImports an alias list from a file.
Import-ClixmlImports a CLIXML file and creates corresponding objects within Windows PowerShell.
Import-CounterImports performance counter log files (.blg, .csv, .tsv) and creates the objects that represent each counter sample in the log.
Import-CSVConverts object properties in a CSV file into CSV versions of the original objects.
Import-LocalizedDataImports language-specific data into scripts and functions based on the UI culture that is selected for the operating system.
Import-ModuleAdds modules to the current session.
Import-PSSessionImports commands from another session into the current session.
Invoke-CommandRuns commands on local and remote computers.
Invoke-ExpressionRuns commands or expressions on the local computer.
Invoke-HistoryRuns commands from the session history.
Invoke-ItemPerforms the default action on the specified item.
Invoke-TroubleshootingPackExecutes a troubleshooting pack in interactive or unattended mode to fix a problem and then generates a results report.
Invoke-WmiMethodCalls WMI methods.
Invoke-WSManActionInvokes an action on the object that is specified by the Resource URI and by the selectors.
Join-PathCombines a path and a child path into a single path. The provider supplies the path delimiters.
Limit-EventLogSets the event log properties that limit the size of the event log and the age of its entries.
Measure-CommandMeasures the time it takes to run script blocks and cmdlets.
Measure-ObjectCalculates the numeric properties of objects and the characters, words, and lines in string objects, such as files of text.
Move-ItemMoves an item from one location to another.
Move-ItemPropertyMoves a property from one location to another.
New-AliasCreates a new alias.
New-AppLockerPolicyCreates a new AppLocker policy from a list of file information and other rule creation options.
New-EventCreates a new event.
New-EventLogCreates a new event log and a new event source on a local or remote computer.
New-ItemCreates a new item.
New-ItemPropertyCreates 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.
New-ModuleCreates a new dynamic module that exists only in memory.
New-ModuleManifestCreates a new module manifest.
New-ObjectCreates an instance of a Microsoft .NET Framework or Component Object Model (COM) object.
New-PSDriveCreates a Windows PowerShell drive in the current session.
New-PSSessionCreates a persistent connection to a local or remote computer.
New-PSSessionOptionCreates an object that contains advanced options for a PSSession.
New-ServiceCreates a new Windows service.
New-TimeSpanCreates a TimeSpan object.
New-VariableCreates a new variable.
New-WebServiceProxyCreates a Web service proxy object that lets you use and manage the Web service in Windows PowerShell.
New-WSManInstanceCreates a new instance of a management resource.
New-WSManSessionOptionCreates a WS-Management session option hash table to use as input parameters to the followingWS-Management cmdlets: Get-WSManInstance, Set-WSManInstance, Invoke-WSManAction, Connect-WSMan.
Out-DefaultSends the output to the default formatter and to the default output cmdlet.
Out-FileSends output to a file.
Out-GridViewSends output to an interactive table in a separate window.
Out-HostSends output to the command line.
Out-NullDeletes output instead of sending it to the console.
Out-PrinterSends output to a printer.
Out-StringSends objects to the host as a series of strings.
Pop-LocationChanges 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.
Push-LocationAdds the current location to the top of a list of locations (a stack).
Read-HostReads a line of input from the console.
Receive-JobGets the results of the Windows PowerShell background jobs in the current session.
Register-EngineEventSubscribes to events that are generated by the Windows PowerShell engine and by the New-Event cmdlet.
Register-ObjectEventSubscribes to the events that are generated by a Microsoft .NET Framework object.
Register-PSSessionConfigurationCreates and registers a new session configuration.
Register-WmiEventSubscribes to a WMI event.
Remove-BitsTransferCancels a BITS transfer job.
Remove-ComputerRemoves the local computer from a workgroup or domain.
Remove-EventDeletes events from the event queue.
Remove-EventLogDeletes an event log or unregisters an event source.
Remove-ItemDeletes the specified items.
Remove-ItemPropertyDeletes the property and its value from an item.
Remove-JobDeletes a Windows PowerShell background job.
Remove-ModuleRemoves modules from the current session.
Remove-PSBreakpointDeletes breakpoints from the current console.
Remove-PSDriveRemoves a Windows PowerShell drive from its location.
Remove-PSSessionCloses one or more Windows PSSessions.
Remove-PSSnapinRemoves Windows PowerShell snap-ins from the current session.
Remove-VariableDeletes a variable and its value.
Remove-WmiObjectDeletes an instance of an existing WMI class.
Remove-WSManInstanceDeletes a management resource instance.
Rename-ItemRenames an item in a Windows PowerShell provider namespace.
Rename-ItemPropertyRenames a property of an item.
Reset-ComputerMachinePasswordResets the machine account password for the computer.
Resolve-PathResolves the wildcard characters in a path and displays the path contents.
Restart-ComputerRestarts (reboots) the operating system on local and remote computers.
Restart-ServiceStops and then starts one or more services.
Restore-ComputerStarts a system restore on the local computer.
Resume-BitsTransferResumes a BITS transfer job.
Resume-ServiceResumes one or more suspended (paused) services.
Select-ObjectSelects 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.
Select-StringFinds text in strings and files.
Select-XMLFinds text in an XML string or document.
Send-MailMessageSends an e-mail message.
Set-AclChanges the security descriptor of a specified resource, such as a file or registry key.
Set-AliasCreates or changes an alias (alternate name) for a cmdlet or other command element in the current Windows PSSession.
Set-AppLockerPolicySets the AppLocker policy for the specified Group Policy object (GPO).
Set-AuthenticodeSignatureAdds an Authenticode signature to a Windows PowerShell script or other file.
Set-BitsTransferModifies the properties of an existing BITS transfer job.
Set-ContentWrites or replaces the content in an item with new content.
Set-DateChanges the system time on the computer to a time that you specify.
Set-ExecutionPolicyChanges the user preference for the Windows PowerShell execution policy.
Set-ItemChanges the value of an item to the value specified in the command.
Set-ItemPropertyCreates or changes the value of a property of an item.
Set-LocationSets the current working location to a specified location.
Set-PSBreakpointSets a breakpoint on a line, command, or variable.
Set-PSDebugTurns script debugging features on and off, sets the trace level, and toggles StrictMode.
Set-PSSessionConfigurationChanges the properties of a registered session configuration.
Set-ServiceStarts, stops, and suspends a service and changes its properties.
Set-StrictModeEstablishes and enforces coding rules in expressions, scripts, and script blocks.
Set-TraceSourceConfigures, starts, and stops a trace of Windows PowerShell components.
Set-VariableSets the value of a variable. Creates the variable if one with the requested name does not exist.
Set-WmiInstanceCreates or updates an instance of an existing WMI class.
Set-WSManInstanceModifies the management information that is related to a resource.
Set-WSManQuickConfigConfigures the local computer for remote management.
Show-EventLogDisplays the event logs of the local or a remote computer in Event Viewer.
Sort-ObjectSorts objects by property values.
Split-PathReturns the specified part of a path.
Start-BitsTransferCreates a new BITS transfer job.
Start-JobStarts a Windows PowerShell background job.
Start-ProcessStarts one or more processes on the local computer.
Start-ServiceStarts one or more stopped services.
Start-SleepSuspends the activity in a script or session for the specified period of time.
Start-TransactionStarts a transaction.
Start-TranscriptCreates a record of all or part of a Windows PSSession in a text file.
Stop-ComputerStops (shuts down) local and remote computers.
Stop-JobStops a Windows PowerShell background job.
Stop-ProcessStops one or more running processes.
Stop-ServiceStops one or more running services.
Stop-TranscriptStops a transcript.
Suspend-BitsTransferSuspends a BITS transfer job.
Suspend-ServiceSuspends (pauses) one or more running services.
Tee-ObjectSaves command output in a file or variable and displays it in the console.
Test-AppLockerPolicyTests whether the input files are allowed to run for a given user based on the specified AppLocker policy.
Test-ComputerSecureChannelTests and repairs the secure channel between the local computer and its domain.
Test-ConnectionSends Internet Control Message Protocol (ICMP) echo request packets (pings) to one or more computers.
Test-ModuleManifestVerifies that a module manifest file accurately describes the contents of a module.
Test-PathDetermines whether all elements of a path exist.
Test-WSManTests whether the WinRM service is running on a local or remote computer.
Trace-CommandConfigures and starts a trace of the specified expression or command.
Undo-TransactionRolls back the active transaction.
Unregister-EventCancels an event subscription.
Unregister-PSSessionConfigurationDeletes registered session configurations from the computer.
Update-FormatDataUpdates the formatting data in the current session.
Update-ListAdds items to and removes items from a property value that contains a collection of objects.
Update-TypeDataUpdates the current extended type configuration by reloading the *.types.ps1xml files into memory.
Use-TransactionAdds the script block to the active transaction.
Wait-EventWaits until a particular event is raised before continuing to run.
Wait-JobSuppresses the command prompt until one or all of the Windows PowerShell background jobs running in the session are complete.
Wait-ProcessWaits for the processes to be stopped before accepting more input.
Where-ObjectCreates a filter that controls which objects will be passed along a command pipeline.
Write-DebugWrites a debug message to the console.
Write-ErrorWrites an object to the error stream.
Write-EventLogWrites an event to an event log.
Write-HostWrites customized output to a host.
Write-OutputSends 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.
Write-ProgressDisplays a progress bar within a Windows PowerShell command window.
Write-VerboseWrites text to the verbose message stream.
Write-WarningWrites a warning message.


No comments:

Post a Comment