Powershell-Build-In Command Line Tools

Powershell has a build-in command line tools-

powershell

  • Get-Help
  • Get-Command
  • Get-Member
  • Get-PSDrive

Get-Help command line based analogous to the main files available

  •  Information specific to an individual CMDLET, for example, Get-Help followed by the cmdlet name
  • Powershell lanaguage and evnironment information, accessed by Get-Help followed by about_topic _name.

 

Helpcommand

Helpcommand2Get-Help

Display information about Windows PowerShell cmdlets and concepts.

Syntax
Get-Help [[-name] string] [-component string[]]
[-functionality string[]]
[-role string[]] [-category string[]]
[ {-full | -detailed | -examples | -parameter string}]
[-Online] [-Path string] [CommonParameters]
Key
-name
Request help about string
A cmdlet name, topic, alias, script or function name. Wildcards are permitted.
e.g. -name Get-Member, -name “About_Object”, -name “ls”
The “-Name” is optional.

-category
Display help for items in the specified category.
Valid values are:  Alias, Cmdlet, Provider, and HelpFile.
Conceptual topics are in the HelpFile category.

-component
Display a list of cmdlets with the specified component value,
such as “Exchange.”

-detailed
Display additional information about a cmdlet, including
descriptions of the parameters and examples of using
the cmdlet. This parameter has no effect on displays
of conceptual (“About_”) help.

-examples
Display examples of using the cmdlet.
To display only the examples, type
“(get-help cmdlet-name).examples”.

-full
Display the entire help file for a cmdlet, including
technical information about the parameters.
This parameter has no effect on displays of
conceptual (“About_”) help.

-functionality
Display help for cmdlets with the specified functionality.
Wildcards are permitted.

-Online
Display the online version of a help topic in the default Internet browser.
This parameter is valid only for cmdlet, function, and script help topics.
see Help about_Comment_Based_Help

-parameter
Display a detailed description of the specified parameter.
These descriptions are included in the Full view of help.
Wildcards are permitted.

-Path string
Get help that explains how the cmdlet works in the specified provider path.
Enter a Windows PowerShell provider path.

This parameter is effective only for help about a provider cmdlet and only when
the provider includes a custom version of the provider cmdlet help topic.

Go to the provider path location and enter Get-Help or, from any path location,
use Get-Help -Path. For more information, see about_Providers.

-role String
Display help customized for the specified user role.
The role that the user plays in an organization.
This parameter has no effect for the core cmdlets.

CommonParameters:
-Verbose, -Debug, -ErrorAction, -ErrorVariable, -WarningAction, -WarningVariable,
-OutBuffer -OutVariable.

Get-Command

Commands are the fundamental part of any shell language: ;They are what you type to get things done.

command – parameter1 -parameters2 argument1 argument2

|               |                  |                    |                |

command name : switch parameter : parameter with argument”  positional argument”

Get-Command is complementary to Get-Help. For example, you type Get-Command at the Powershell prompt, you will see Alissa, Functions and Cmdlet ”

getcommand

getcommand2

For example, Get-Command ipconfig.exe: |format -List

getomandipconfigGet-Member

Get-Member is the best described as the Swiss Army knife of Powershell, Type; Get-Help Get-Member to display it.

Getmember

NAME
Get-Process

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

SYNTAX
Get-Process [[-Name] [<String[]>]] [-ComputerName [<String[]>]] [-FileVersionInfo] [-InformationAction {SilentlyContinue
| Stop | Continue | Inquire | Ignore | Suspend}] [-InformationVariable [<System.String]>]] [-Module] [<CommonParameters>]

Get-Process [-ComputerName [<String[]>]] [-FileVersionInfo] [-InformationAction {SilentlyContinue | Stop | Continue |
Inquire | Ignore | Suspend}] [-InformationVariable [<System.String]>]] [-Module] -InputObject <Process[]>
[<CommonParameters>]

Get-Process [-ComputerName [<String[]>]] [-FileVersionInfo] [-InformationAction {SilentlyContinue | Stop | Continue |
Inquire | Ignore | Suspend}] [-InformationVariable [<System.String]>]] [-Module] -Id <Int32[]> [<CommonParameters>]

Get-Process [-InformationAction {SilentlyContinue | Stop | Continue | Inquire | Ignore | Suspend}] [-InformationVariable
[<System.String]>]] -Id <Int32[]> -IncludeUserName [<CommonParameters>]

Get-Process [-InformationAction {SilentlyContinue | Stop | Continue | Inquire | Ignore | Suspend}] [-InformationVariable
[<System.String]>]] -IncludeUserName -InputObject <Process[]> [<CommonParameters>]

Get-Process [[-Name] [<String[]>]] [-InformationAction {SilentlyContinue | Stop | Continue | Inquire | Ignore |
Suspend}] [-InformationVariable [<System.String]>]] -IncludeUserName [<CommonParameters>]

DESCRIPTION
The Get-Process cmdlet gets the processes on a local or remote computer.

Without parameters, Get-Process gets all of the processes on the local computer. You can also specify a particular
process by process name or process ID (PID) or pass a process object through the pipeline to Get-Process.

By default, Get-Process returns a process object that has detailed information about the process and supports methods
that let you start and stop the process. You can also use the parameters of Get-Process to get file version information
for the program that runs in the process and to get the modules that the process loaded.

RELATED LINKS
Online Version: http://go.microsoft.com/fwlink/p/?linkid=290498
Debug-Process
Get-Process
Start-Process
Stop-Process
Wait-Process

REMARKS
To see the examples, type: “get-help Get-Process -examples”.
For more information, type: “get-help Get-Process -detailed”.
For technical information, type: “get-help Get-Process -full”.
For online help, type: “get-help Get-Process -online”

Get-PSDRIVE

Get-PSDRIVE displays information about the providers that are currently installed. Full details were supplied

Get-PSDrive

getdrive

Get drive information (gdr)

Syntax
Get-PSDrive { [[-name] string[]] | [-literalName] string[]  }
[-Force] [-pSProvider string[]] [-scope string]
[-UseTransaction] [CommonParameters]

Key
-name string
Get only the specified drives.
Type the drive name or letter without a colon (:),
separate multiple names with commas.

-literalName string
The Drive name which will be used exactly as typed.
No characters are interpreted as wildcards. If the name includes escape
characters, enclose it in single quotation marks.

-pSProvider
Get only the drives supported by the specified PowerShell provider.
Type the name of a provider, such as:
FileSystem, Registry, or Certificate.

-scope
The scope within which to search for the drive.
Valid values are “Global”, “Local”, or “Script”, or a number relative
to the current scope (0 through the number of scopes, where 0 is the
current scope and 1 is its parent).
“Local” is the default. For more information, see about_Scopes.

-UseTransaction
Include the command in the active transaction.

CommonParameters:
-Verbose, -Debug, -ErrorAction, -ErrorVariable, -WarningAction, -WarningVariable,
-OutBuffer -OutVariable.

Standard Aliases for Get-PSDrive: gdr

Get-PSDrive gets the PowerShell drives in the current session. You can get a particular drive or all drives in the console.

Get-PSDrive gets the following drives:

– Windows logical drives on the computer, including drives mapped to network shares.
– Drives exposed by PowerShell providers (such as the Certificate:, Function:, and Alias: drives) and the HKLM: and HKCU: Registry drives.
– Drives created with New-PSDrive.

Get-PSDrive does not get Windows mapped drives that are added or created after the PowerShell console is opened.

Examples

Display information about all currently visible drives:

PS C:\> get-psdrive

Display the description of a PowerShell drive on your system:

PS C:\> (get-psdrive DriveName).description

Display information for drives with names that begin with HK (registry: HKLM, HKCU etc):

PS C:\> get-psdrive HK*

Display information for FileSystem drives:

PS C:\> get-psdrive -psprovider filesystem

References:
Powershell.exe Command Line Help.
https://technet.microsoft.com/en-us/library/hh847736.aspx

 


Leave a Reply

Your email address will not be published. Required fields are marked *