- Home
- Products
- Integration
- Tutorial
- Barcode FAQ
- Purchase
- Company
The same old commands almost in VB.NET
The same old commands almost Data Matrix ECC200 Generation In VB.NET Using Barcode maker for .NET framework Control to generate, create Data Matrix ECC200 image in VS .NET applications. www.OnBarcode.comDataMatrix Scanner In Visual Basic .NET Using Barcode scanner for .NET Control to read, scan read, scan image in .NET applications. www.OnBarcode.comdash, name, space, value. After that, they never wonder if parameter names should start with a dash or a slash, or if there s supposed to be an equal sign or colon in between the name and value. It s dash, name, space, value, and never anything else. Parameter names are used consistently throughout the shell. If one cmdlet has a -computerName parameter, which is used for specifying a computer name, then most cmdlets that need a computer name will also have a -computerName parameter. Both parameter and cmdlet names are intended to be clear and meaningful. When you look at a cmdlet name like Get-Content, you should be pretty clear that it s getting some kind of content from something. A parameter name like -credential doesn t leave much to the imagination, either you should be pretty certain what that parameter is going to do. Because clear can sometimes mean lengthy, Microsoft gives you shortcuts for cmdlet names and parameter names, to save you some typing. Cmdlet names can be given shorter aliases, as we ve already discussed, and parameter names don t need to be typed in their entirety. For example, if -recurse is the only parameter of Get-ChildItem that starts with the letter r, then you only have to type -r and PowerShell will know what you mean. If a cmdlet has both a -computerName and -credential parameter, typing -comp will probably be enough for PowerShell to figure out that you mean the -computerName parameter. Print 1D Barcode In Visual Basic .NET Using Barcode creator for .NET Control to generate, create Linear 1D Barcode image in .NET framework applications. www.OnBarcode.comPainting EAN-13 Supplement 5 In Visual Basic .NET Using Barcode drawer for VS .NET Control to generate, create European Article Number 13 image in VS .NET applications. www.OnBarcode.comThis is another good place for me to remind you to be a neat, careful typist. GetChildItem-recurse is incorrect, because there s no space between the end of the cmdlet name and the dash that starts the parameter name. Get-ChildItem -recurse is correct, with that space in between the two elements. It s very, very important that you focus on those little typing details, because getting them wrong will generate sometimes-confusing errors that will do nothing but slow you down. PowerShell is all about consistency. That s not to say it s 100 percent consistent, because it is, after all, the product of many human beings, who do tend to make mistakes sometimes. But it s pretty consistent most of the time. In the previous chapter, I wrote about how graphical user interfaces (GUIs) offer features to help you figure out what you can do with them: right-click menus, tooltips, menus, and so forth. Programmers refer to those features as discoverability features, because they literally help you discover the tool s capabilities. A command-line interface (CLI) like PowerShell lacks those kinds of graphical discoverability features, but consistency can provide a kind of discoverability of its own. For example, let s say I told you that the cmdlet verb Get was used for all cmdlets that retrieve or display something (as with Get-Content). You already know that cmdlet Generate EAN128 In Visual Basic .NET Using Barcode generator for .NET Control to generate, create GS1 128 image in Visual Studio .NET applications. www.OnBarcode.comData Matrix 2d Barcode Generation In Visual Basic .NET Using Barcode creation for Visual Studio .NET Control to generate, create DataMatrix image in .NET applications. www.OnBarcode.comRunning commands
Encode Universal Product Code Version A In Visual Basic .NET Using Barcode printer for .NET Control to generate, create Universal Product Code version A image in .NET applications. www.OnBarcode.comCreate Planet In VB.NET Using Barcode creation for Visual Studio .NET Control to generate, create Planet image in .NET applications. www.OnBarcode.comnouns are singular, and never plural. Can you guess the names of the cmdlets that would perform the tasks in table 2.3 Encoding Data Matrix ECC200 In None Using Barcode printer for Software Control to generate, create Data Matrix image in Software applications. www.OnBarcode.comDraw ECC200 In Java Using Barcode drawer for Java Control to generate, create Data Matrix image in Java applications. www.OnBarcode.comTable 2.3 Guessing the cmdlet names for specific tasks Task Display a list of services Display a list of running processes Display the contents of an event log Create a new service Retrieve Exchange mailboxes Create a new Exchange mailbox Cmdlet Paint UCC - 12 In None Using Barcode creation for Office Word Control to generate, create GS1 - 12 image in Word applications. www.OnBarcode.comBarcode Reader In VB.NET Using Barcode decoder for Visual Studio .NET Control to read, scan read, scan image in VS .NET applications. www.OnBarcode.comAll of those tasks can be accomplished with one of two verbs: Get or New. From there, you just have to make an educated guess about the noun. The right answers are shown in table 2.4. Generate Code 128 Code Set A In Java Using Barcode generator for BIRT Control to generate, create Code 128 image in BIRT reports applications. www.OnBarcode.comEAN-13 Supplement 5 Generator In Java Using Barcode creator for Java Control to generate, create UPC - 13 image in Java applications. www.OnBarcode.comTable 2.4 Introducing some new cmdlets Task Display a list of services Display a list of running processes Display the contents of an event log Create a new service Retrieve Exchange mailboxes Create a new Exchange mailbox Get-Service Get-Process Get-EventLog New-Service Get-Mailbox New-Mailbox Cmdlet UPCA Reader In Java Using Barcode scanner for Java Control to read, scan read, scan image in Java applications. www.OnBarcode.comData Matrix ECC200 Creator In Java Using Barcode generator for Java Control to generate, create ECC200 image in Java applications. www.OnBarcode.comThe last two cmdlets in table 2.4 aren t native to PowerShell, and you won t be able to try them unless you have the Exchange Server 2007 (or 2010) add-in loaded, which isn t something we re going to cover just now. The point for right now is guessing the right cmdlet name if you were able to do that, then you re well on your way to mastering the shell. More importantly, don t ever be afraid to guess a cmdlet name, and don t be afraid to be wrong. In the next chapter, I ll show you how to check and see if your guesses are correct, and how to teach yourself how to use a cmdlet once you ve discovered its name. I ll also show you how to search for cmdlets based on a part of their name, which can be another useful trick for discovering new cmdlets. Barcode Generation In None Using Barcode printer for Font Control to generate, create Barcode image in Font applications. www.OnBarcode.comPainting Linear 1D Barcode In C# Using Barcode generator for VS .NET Control to generate, create 1D image in .NET applications. www.OnBarcode.comCreating QR Code 2d Barcode In None Using Barcode printer for Software Control to generate, create QR Code image in Software applications. www.OnBarcode.comMaking EAN / UCC - 13 In Visual Studio .NET Using Barcode printer for ASP.NET Control to generate, create EAN / UCC - 13 image in ASP.NET applications. www.OnBarcode.com |
|