What is the difference between the -Name and -noun parameters in PowerShell? Who can give me some examples? Thanks for everything
What is the difference between the -Name and -noun parameters in PowerShell? Who can give me some examples? Thanks for everything
PowerShell cmdlets (and functions) have a name. For example: Get-Service
Cmdlet (and function) names are a combination of an action (i.e. a 'verb') and an object (i.e. a 'noun') which are separated by a hyphen ("-").
Verbs might be "Set", "Get", "Import", "Export", etc.
Nouns might be "Service", "ADUser", "ADGroup", "ADComputer", "NetAdapter", "CSV", etc.
Combining a Verb and a Noun would produce names (choosing just from the limited choices above) like "Import-CSV", "Get-ADUser", "Set-ADComputer", etc.
So when I find Get-Command -Noun EvertLog, -Nounun is only referring to the fact of telling the Command to find the verb for the Eventlog Object right?
No, it's asking for all the cmdlets and functions that use the noun "eventlog" regardless of the verb.
Get-Command -Noun EventLog
CommandType Name Version Source
----------- ---- ------- ------
Cmdlet Clear-EventLog 3.1.0.0 Microsoft.PowerShell.Management
Cmdlet Get-EventLog 3.1.0.0 Microsoft.PowerShell.Management
Cmdlet Limit-EventLog 3.1.0.0 Microsoft.PowerShell.Management
Cmdlet New-EventLog 3.1.0.0 Microsoft.PowerShell.Management
Cmdlet Remove-EventLog 3.1.0.0 Microsoft.PowerShell.Management
Cmdlet Show-EventLog 3.1.0.0 Microsoft.PowerShell.Management
Cmdlet Write-EventLog 3.1.0.0 Microsoft.PowerShell.Management
17 people are following this question.