1

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",

  1. what do we mean by : Position? named
  2. 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
    
1
  • Required? is a question "Is this parameter required?" Same with Position? "What is the position of this parameter?" named means you have to name the parameter for it to exist. Commented Jun 13, 2013 at 18:45

2 Answers 2

3

For #1, you need to understand how positional parameters are used in PowerShell. You can refer to the following scripting guys article on that.

http://blogs.technet.com/b/heyscriptingguy/archive/2012/04/22/the-problem-with-powershell-positional-parameters.aspx

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.

Sign up to request clarification or add additional context in comments.

Comments

1

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.