Reputation: 3511
I am learning powershell, so first i am learning how to use the help system of powershell. Below is the help for command "Get-EventLog",
Also is there any links to get more on how to use the help system provided by powershell?
Synopsis Gets the events in an event log, or a list of the event logs, on the local or remote computers.
Syntax Get-EventLog [-LogName] <String> [[-InstanceId] <Int64[]>] [-After <DateTime>] [-AsBaseObject <SwitchParameter>] [-Before <DateTime>] [-ComputerName <String[]>] [-EntryType <String[]>] [-Index <Int32[]>] [-Message <String>] [-Newest <Int32>] [-Source <String[]>] [-UserName <String[]>] [<CommonParameters>]
Get-EventLog [-AsString <SwitchParameter>] [-ComputerName <String[]>] [-List <SwitchParameter>] [<CommonParameters>]
Parameters
-After <DateTime>
Gets only the events that occur after the specified date and time. Enter a DateTime object, such as the one returned by the Get-Date cmdlet.
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-InstanceId <Int64[]>
Gets only events with the specified instance IDs.
Required? false
Position? 2
Default value
Accept pipeline input? false
Accept wildcard characters? false
-LogName <String>
Specifies the event log. Enter the log name (the value of the Log property; not the LogDisplayName) of one event log. Wildcard characters are not permitted. This parameter is required.
Required? true
Position? 1
Default value
Accept pipeline input? false
Accept wildcard characters? false
Upvotes: 1
Views: 326
Reputation: 72630
You can first have a look to about_Command_Syntax
get_help about_Command_Syntax
Then have a look at a few other abouts, if you want to add your own help to your Cmd-Lets have a look here.
Upvotes: 1
Reputation: 25810
For #1, you need to understand how positional parameters are used in PowerShell. You can refer to the following scripting guys article on that.
For #2, in PowerShell v3, there is update-able help. By default, on PowerShell 3.0 systems, there is no help installed. Everything is online. You can download the help content using Update-Help
and Save-Help
cmdlets.
Also, Get-Help <cmdletname> -Online
shows the online (most up-to-date) content for any cmdlet.
You can use the about topics in PowerShell to learn the concepts. These about topics can be accessed using help about*
. You will see a huge list of topics which can be accessed using help or Get-Help. For example,
help about_Parameters
Once again, if you are using PowerShell 3.0, you need to update the help first to be able to see any help content.
Upvotes: 3