IT tutorials
 
Technology
 

Windows Server 2008 : Tabbing Through PowerShell Commands, Understanding the Different Types of PowerShell Commands

10/6/2013 7:37:17 PM
- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019

Tabbing Through PowerShell Commands

One of the benefits of knowing the verbs is that it enables you to easily discover the commands using the tab completion, or tab expansion feature. With more than 400 commands, you simply can’t remember them all. However, you can remember common verbs such as get, set, start, and stop. You enter the name of the verb, and then simply press the Tab key to discover all the available commands. The following steps show this process.

StepComments
1. Launch PowerShell.Click Start, type PowerShell in the Search text box, and double-click Windows PowerShell.
2. Type get-.get is a common noun. It retrieves information.
3. Press the Tab key.The get command changes to Get-Acl. If you press Enter at this point, it executes the get-acl command.

Note

PowerShell is not case sensitive, but it does automatically change to Pascal casing, or camel case, for easier readability. Camel casing uses an uppercase letter for each new word.

4. Continue to press the Tab key to discover all of the commands beginning with get-.There are about 50 get commands that you can discover using this method.

Note

The command get-command get* | measure-object shows the exact number of commands.

5. Press the Esc key to clear the PowerShell command.Pressing Esc clears the command line the same way in PowerShell as it works from the command prompt.
6. Type set-.set is another common noun. It is used to configure settings.
7. Press the Tab key.The set command changes to Set-Acl. If you press Enter at this point, it tries to execute the set-acl command. However, because the set-acl command requires additional parameters, it won’t complete.

Tip

You can get additional help on any command by entering the get-help command. For example, get-help set-acl retrieves information on this command.

8. Continue to press the Tab key to discover all of the commands beginning with set-.There are about 35 set commands that you can discover using this method.

Note

The command get-command set* | measure-object shows the actual count based on the version of PowerShell you’re running.

9. Try the same method with any of the other verbs, such as out or write.This is one of the core self-discovery methods built into Windows PowerShell.

Tip

Windows PowerShell has the equivalent of the command prompt’s doskey. It keeps a history of previous commands, and you can use the up arrow, down arrow, F7, home, end, page up, and page down keys to navigate through the history. The get-command *history* command shows all the commands you can use with history. For example, you can execute get-history to show a listing of all commands you’ve entered during this session.

Understanding the Different Types of PowerShell Commands

All PowerShell commands aren’t the same. There are actually three distinct types of commands, as shown in the following table.

TypeComments
CmdletCmdlets are mini-programs. They are created as objects with properties and methods. Properties describe the object and methods perform actions.
AliasAliases are simpler names for common commands. For example, you can enter the command get-alias to list all aliases. The get-alias command actually has two aliases that you can execute instead of get-alias: gal and alias. All three commands (get-alias, gal, and alias) perform the same command.
FunctionFunctions perform a specific action. For example, the E: function changes the drive to E. The clear-host function clears the screen.

Note

You can create your own cmdlets, aliases, and functions. Creating cmdlets can be complex, but creating aliases and functions is easy.

 
Others
 
- Windows Server 2008 : Understanding PowerShell Verbs and Nouns
- Windows Server 2008 : Installing and Launching PowerShell
- Sharepoint 2013 : Working with PowerShell (part 3) - PowerShell and SharePoint - Web Applications, Site Collections, Memory and Disposal
- Sharepoint 2013 : Working with PowerShell (part 2) - PowerShell and SharePoint - Administration Permissions, Content Databases
- Sharepoint 2013 : Working with PowerShell (part 1) - PowerShell Basics
- Exchange Server 2010 Quick Start Guide : Installing Exchange Server 2010
- Exchange Server 2010 Quick Start Guide : Configuring Windows Server 2008 R2
- Exchange Server 2010 Quick Start Guide : Server Sizing Quick Reference
- Microsoft Lync Server 2010 : UCMA (part 3) - Walkthrough of the UCMA 3.0 Components - Toolbox Components, Error Condition Components
- Microsoft Lync Server 2010 : UCMA (part 2) - Walkthrough of the UCMA 3.0 Components
 
 
Top 10
 
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
Technology FAQ
- Is possible to just to use a wireless router to extend wireless access to wireless access points?
- Ruby - Insert Struct to MySql
- how to find my Symantec pcAnywhere serial number
- About direct X / Open GL issue
- How to determine eclipse version?
- What SAN cert Exchange 2010 for UM, OA?
- How do I populate a SQL Express table from Excel file?
- code for express check out with Paypal.
- Problem with Templated User Control
- ShellExecute SW_HIDE
programming4us programming4us