2013-06-13 86 views
1

我正在学习PowerShell,所以首先我正在学习如何使用PowerShell的帮助系统。下面是命令“Get-EventLog”的帮助,Powershell帮助系统使用

  1. 我们的意思是:位置?命名为
  2. 还有什么链接可以获得更多关于如何使用powershell提供的帮助系统 ?

    剧情简介 获取本地或远程计算机上的事件日志或事件日志列表中的事件。

    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 
    
+0

'必须?'是一个问题“是否需要此参数?”与“位置?”一样吗?“这个参数的位置是什么?” 'named'意味着你必须命名参数以使其存在。 –

回答

3

#1,您需要了解参数是如何定位在PowerShell中被使用。你可以参考下面的脚本文章。

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

#2,在PowerShell中V3,还有更新能够帮助。默认情况下,在PowerShell 3.0系统上,没有安装帮助。一切都在线。您可以使用Update-HelpSave-Help cmdlet下载帮助内容。

此外,Get-Help <cmdletname> -Online显示任何cmdlet的在线(最新)内容。

您可以在PowerShell中使用about主题来了解这些概念。有关主题的信息可以使用help about*访问。您将看到可以使用帮助或Get-Help访问的主题列表。例如,

help about_Parameters

再次,如果您使用的PowerShell 3.0,则需要先更新的帮助下能够看到任何的帮助内容。

1

你可以先看看到about_Command_Syntax

get_help about_Command_Syntax 

然后看看其他几个abouts,如果你想在自己的帮助下添加到您的加利福尼亚 - 让我们看看here