• No se han encontrado resultados

Amenaza de daño en el Acuerdo Antidumping

CAPITULO III DETERMINACIÓN DE AMENAZA DE DAÑO

III.2 Amenaza de daño en el Acuerdo Antidumping

Windows PowerShell provides a cmdlet, Get-Help, that accesses the help system. You may see examples (especially on the internet) that show people using the Help key- word instead, or even the Man keyword (which comes from Unix and means “Man- ual”). Man and Help aren’t native cmdlets at all—they are functions, which are wrappers around the core Get-Help cmdlet.

Help works much like the base Get-Help, but it pipes the help output to More, allow- ing you to have a nice paged view instead of seeing all the help fly by at once. Running Help Get-Content and Get-Help Get-Content produces the same results, but the for- mer has a page-at-a-time display. You could run Get-Help Get-Content | More to pro- duce that paged display, but it’s a lot more typing. We’ll typically only use Help, but we want you to understand that there’s some trickery going on under the hood.

NOTE Technically, Help is a function, and Man is an alias, or nickname, for Help. But you get the same results using either. We’ll discuss aliases in the next chapter.

By the way, sometimes that paginated display can be annoying—you have the informa- tion you need, but it still wants you to hit the spacebar to display the remaining

information. If you encounter this, press Ctrl-C to cancel the command and return to the shell prompt. Within the shell’s console window, Ctrl-C always means “break” rather than “copy to the clipboard.” But in the more graphically oriented Windows PowerShell ISE, Ctrl-C does copy to the clipboard. A red “stop” button in the toolbar will stop a running command.

NOTE The More command won’t work in the ISE. Even if you use Help or Man, the help content displays all at once rather than a page at a time.

The help system has two main goals: to help you find commands to perform specific tasks, and to help you learn how to use those commands once you’ve found them.

3.4

Using help to find commands

Technically speaking, the help system has no idea what commands are present in the shell. All it knows is what help topics are available, and it’s possible for commands to not have a help file, in which case the help system won’t know that the commands exist. Fortunately, Microsoft ships a help topic for nearly every cmdlet they produce, which means you usually won’t find a difference. In addition, the help system can also access information that isn’t related to a specific cmdlet, including background con- cepts and other general information.

Like most commands, Get-Help (and therefore Help) has several parameters. One of those—perhaps the most important one—is -Name. This parameter specifies the name of the help topic you’d like to access, and it’s a positional parameter, so you don’t have to type -Name—you can just provide the name you’re looking for. It also accepts wildcards, which makes the help system useful for discovering commands.

For example, suppose you want to do something with an event log. You don’t know what commands might be available, and you decide to search for help topics that cover event logs. You might run either of these two commands:

Help *log* Help *event*

The first of these commands returns a list like the following on your computer:

Name Category Module ---- --- ---

Clear-EventLog Cmdlet Microsoft.PowerShell.M... Get-EventLog Cmdlet Microsoft.PowerShell.M... Limit-EventLog Cmdlet Microsoft.PowerShell.M... New-EventLog Cmdlet Microsoft.PowerShell.M... Remove-EventLog Cmdlet Microsoft.PowerShell.M... Show-EventLog Cmdlet Microsoft.PowerShell.M... Write-EventLog Cmdlet Microsoft.PowerShell.M... Get-AppxLog Function Appx

Get-DtcLog Function MsDtc Reset-DtcLog Function MsDtc Set-DtcLog Function MsDtc

Set-LogProperties Function PSDiagnostics about_Eventlogs HelpFile

about_Logical_Operators HelpFile

NOTE You’ll notice that the preceding list includes commands (and func- tions) from modules like Appx, MsDtc, and so forth. The help system displays all of these even though you haven’t loaded those extensions into memory yet, which helps you discover commands on your computer that you might otherwise have overlooked. It’ll discover commands from any extensions that are installed in the proper location, which we’ll discuss in chapter 7.

Many of the functions in the previous list seem to have something to do with event logs, and based on a “verb-noun” naming format, all but the last two appear to be help topics related to specific cmdlets. The last two “about” topics provide background information. The last one doesn’t seem to have anything to do with event logs, but it came up because it does have “log” in it—part of the word “logical.” Whenever possi- ble, we try to search using the broadest term possible—“*event*” or “*log*” as opposed to “*eventlog*”—because we’ll get the most results possible.

Once you have a cmdlet that you think will do the job (Get-EventLog looks like a good candidate for what you’re after in the example), you can ask for help on that specific topic:

Help Get-EventLog

Don’t forget about tab completion! As a reminder, it lets you type a portion of a com- mand name, press Tab, and the shell will complete what you’ve typed with the closest match. You can continue pressing Tab to cycle through alternative matches.

TRY IT NOW Type Help Get-Ev and press Tab. The first match is Get-Event, which isn’t what you want; pressing Tab again brings up Get-EventLog, which is what you’re after. You can hit Return to accept the command and display the help for that cmdlet. If you’re using the ISE, you don’t even have to hit Tab; the list of matching commands pops right up, and you can select one and hit Enter to finish typing it.

You can also use wildcards—mainly the * wildcard, which stands in for zero or more characters—with Help. If PowerShell only finds one match to whatever you’ve typed, it won’t display a list of topics with that one item. Instead, it’ll display the contents for that item.

TRY IT NOW Run Help Get-EventL* and you should see the help file for Get-EventLog, rather than a list of matching help topics.

If you’ve been following along in the shell, you should now be looking at the help file for Get-EventLog. This file is called the summary help, and it’s meant to be a short description of the command and a reminder of the syntax. This information is useful when you need to quickly refresh your memory of a command’s usage, and it’s where we’ll begin interpreting the help file itself.