locked
How to Research commands and information about parameters on Powershell RRS feed

  • Question

  • i'm new to powershell and trying to learn the ropes about how to script using powershell. One of the things that i am struggling with is the fact that i cannot figure out how to get information about about a parameter for a particular command

    For example - Get-EventLog

    i used the help and it showed me all the parameters needed to write a script using Get-EventLog

    LogName is supposed to a required parameter. 

    My question is how can i check what lognames are available to pick from is there a handy technique being used

    i have another example

    Get-WMIobject...who required parameter is ClassName....same question as the previous example ..how do i get all the classNames available to pick from

     
    Wednesday, July 12, 2017 2:30 PM

Answers

  • To a great degree the answers to your questions require a technical knowledge of Windows.  There are many books on the Windows NT architecture.  These will teach you how to use and understand the event log.

    PowerShell assumes you are trained in the technology that you wish to work with.  It will show you the available CmdLets and provide parameter help but why and where you would use this requires technical background in the subsystem.

    The best place to start with PowerShell is with one of the may detailed books on PowerShell or by taking a tutorial.

    The simple answer to your question is that "Get-EventLog" is deprecated and not very useful for modern Windows.  In all current versions we would use "Get-WinEvent"

    Get-WinEvent -ListLog *


    \_(ツ)_/

    • Marked as answer by dongotti Wednesday, July 12, 2017 5:32 PM
    Wednesday, July 12, 2017 2:54 PM