Monday, October 21, 2013

powershell : Using help to find commands

Using help to find 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
Get-LogProperties Function PSDiagnostics
Set-LogProperties Function PSDiagnostics
about_Eventlogs HelpFile
about_Logical_Operators HelpFile

NOTE You’ll notice that the preceding list includes commands (and functions)
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,
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

Featured Posts

Adding Accesspolicy to KeyVault for Service Principal Using Portal and Powershell

  Scripts path : https://drive.google.com/drive/folders/1sbBpnVFgXhUIXLdf2E9heyWDeU2f9427?usp=sharing  Adding Accesspolicy to KeyVault for S...