external help file | Module Name | online version | schema |
---|---|---|---|
PSScriptTools-help.xml |
PSScriptTools |
2.0.0 |
Get the methods of a CIM class.
Get-CimClassMethod [-ClassName] <String> [-Method <String>] [-Namespace <String>] [-CimSession <CimSession>] [<CommonParameters>]
This command is an alternative to Get-CimClass to make it easier to get information about methods of a WMI/CIM class. The default behavior is to query classes on the local host, but you can query a remote computer using the CimSession parameter. You can specify a computer name, or an existing CIMSession if you need alternate credentials.
PS C:\> Get-CimClassMethod Win32_ComputerSystem
Class: Root/Cimv2:Win32_ComputerSystem
Name ResultType Parameters
---- ---------- ----------
JoinDomainOrWorkgroup UInt32 {Name, Password, UserName, AccountOU…}
Rename UInt32 {Name, Password, UserName}
SetPowerState UInt32 {PowerState, Time}
UnjoinDomainOrWorkgroup UInt32 {Password, UserName, FUnjoinOptions}
The default is to show all methods.
PS C:\> Get-CimClassMethod Win32_ComputerSystem -Name Rename | Select-Object -ExpandProperty Parameters
Name CimType Qualifiers ReferenceClassName
---- ------- ---------- ------------------
Name String {ID, In}
Password String {ID, In}
UserName String {ID, In}
You can get a single method by name.
Specify a computer name or an existing CimSession object.
Type: CimSession
Parameter Sets: (All)
Aliases: CN
Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False
Specify a CIM Class
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 0
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False
Specify a method name. Wildcards are permitted.
Type: String
Parameter Sets: (All)
Aliases: Name
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: True
Specify the class namespace beginning with ROOT
Type: String
Parameter Sets: (All)
Aliases: NS
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.