@@ -18,63 +18,65 @@ Invokes a method of a CIM class.
1818### ClassNameComputerSet (Default)
1919
2020```
21- Invoke-CimMethod [-ClassName] <String> [-ComputerName <String[]>] [[-Arguments] <IDictionary>]
22- [-MethodName ] <String> [-Namespace <String>] [-OperationTimeoutSec <UInt32>] [-WhatIf] [-Confirm ]
23- [<CommonParameters>]
21+ Invoke-CimMethod [-ClassName] <String> [-ComputerName <String[]>]
22+ [[-Arguments ] <IDictionary>] [-MethodName] <String> [-Namespace <String> ]
23+ [-OperationTimeoutSec <UInt32>] [-WhatIf] [-Confirm] [ <CommonParameters>]
2424```
2525
2626### ClassNameSessionSet
2727
2828```
29- Invoke-CimMethod [-ClassName] <String> -CimSession <CimSession[]> [[-Arguments] <IDictionary>]
30- [-MethodName ] <String> [-Namespace <String>] [-OperationTimeoutSec <UInt32>] [-WhatIf] [-Confirm ]
31- [<CommonParameters>]
29+ Invoke-CimMethod [-ClassName] <String> -CimSession <CimSession[]>
30+ [[-Arguments ] <IDictionary>] [-MethodName] <String> [-Namespace <String> ]
31+ [-OperationTimeoutSec <UInt32>] [-WhatIf] [-Confirm] [ <CommonParameters>]
3232```
3333
3434### ResourceUriComputerSet
3535
3636```
37- Invoke-CimMethod -ResourceUri <Uri> [-ComputerName <String[]>] [[-Arguments] <IDictionary>]
38- [-MethodName ] <String> [-Namespace <String>] [-OperationTimeoutSec <UInt32>] [-WhatIf] [-Confirm ]
39- [<CommonParameters>]
37+ Invoke-CimMethod -ResourceUri <Uri> [-ComputerName <String[]>]
38+ [[-Arguments ] <IDictionary>] [-MethodName] <String> [-Namespace <String> ]
39+ [-OperationTimeoutSec <UInt32>] [-WhatIf] [-Confirm] [ <CommonParameters>]
4040```
4141
4242### CimInstanceSessionSet
4343
4444```
45- Invoke-CimMethod [-ResourceUri <Uri>] [-InputObject] <CimInstance> -CimSession <CimSession[]>
46- [[ -Arguments] <IDictionary>] [-MethodName] <String> [-OperationTimeoutSec <UInt32>] [-WhatIf]
47- [-Confirm] [<CommonParameters>]
45+ Invoke-CimMethod [-ResourceUri <Uri>] [-InputObject] <CimInstance>
46+ -CimSession <CimSession[]> [[ -Arguments] <IDictionary>] [-MethodName] <String>
47+ [-OperationTimeoutSec <UInt32>] [-WhatIf] [- Confirm] [<CommonParameters>]
4848```
4949
5050### CimInstanceComputerSet
5151
5252```
53- Invoke-CimMethod [-ResourceUri <Uri>] [-InputObject] <CimInstance> [-ComputerName <String[]>]
54- [[ -Arguments] <IDictionary>] [-MethodName] <String> [-OperationTimeoutSec <UInt32>] [-WhatIf]
55- [-Confirm] [<CommonParameters>]
53+ Invoke-CimMethod [-ResourceUri <Uri>] [-InputObject] <CimInstance>
54+ [-ComputerName <String[]>] [[ -Arguments] <IDictionary>] [-MethodName] <String>
55+ [-OperationTimeoutSec <UInt32>] [-WhatIf] [- Confirm] [<CommonParameters>]
5656```
5757
5858### ResourceUriSessionSet
5959
6060```
61- Invoke-CimMethod -ResourceUri <Uri> -CimSession <CimSession[]> [[-Arguments] <IDictionary>]
62- [-MethodName ] <String> [-Namespace <String>] [-OperationTimeoutSec <UInt32>] [-WhatIf] [-Confirm ]
63- [<CommonParameters>]
61+ Invoke-CimMethod -ResourceUri <Uri> -CimSession <CimSession[]>
62+ [[-Arguments ] <IDictionary>] [-MethodName] <String> [-Namespace <String> ]
63+ [-OperationTimeoutSec <UInt32>] [-WhatIf] [-Confirm] [ <CommonParameters>]
6464```
6565
6666### CimClassComputerSet
6767
6868```
69- Invoke-CimMethod [-CimClass] <CimClass> [-ComputerName <String[]>] [[-Arguments] <IDictionary>]
70- [-MethodName] <String> [-OperationTimeoutSec <UInt32>] [-WhatIf] [-Confirm] [<CommonParameters>]
69+ Invoke-CimMethod [-CimClass] <CimClass> [-ComputerName <String[]>]
70+ [[-Arguments] <IDictionary>] [-MethodName] <String> [-OperationTimeoutSec <UInt32>]
71+ [-WhatIf] [-Confirm] [<CommonParameters>]
7172```
7273
7374### CimClassSessionSet
7475
7576```
76- Invoke-CimMethod [-CimClass] <CimClass> -CimSession <CimSession[]> [[-Arguments] <IDictionary>]
77- [-MethodName] <String> [-OperationTimeoutSec <UInt32>] [-WhatIf] [-Confirm] [<CommonParameters>]
77+ Invoke-CimMethod [-CimClass] <CimClass> -CimSession <CimSession[]>
78+ [[-Arguments] <IDictionary>] [-MethodName] <String> [-OperationTimeoutSec <UInt32>]
79+ [-WhatIf] [-Confirm] [<CommonParameters>]
7880```
7981
8082### QueryComputerSet
@@ -122,7 +124,11 @@ If the **InputObject** parameter is specified, the cmdlet works in one of the fo
122124This example invokes the ** Terminate** method of the ** Win32_Process** class.
123125
124126``` powershell
125- Invoke-CimMethod -Query 'select * from Win32_Process where name like "notepad%"' -MethodName "Terminate"
127+ $method = @{
128+ Query = 'select * from Win32_Process where name like "notepad%"'
129+ MethodName = "Terminate"
130+ }
131+ Invoke-CimMethod @method
126132```
127133
128134### Example 2: Invoke a method using CIM instance object
@@ -265,7 +271,7 @@ to invoke instance methods. To invoke class static methods, use the **Class** pa
265271
266272` ` ` yaml
267273Type: Microsoft.Management.Infrastructure.CimInstance
268- Parameter Sets: CimInstanceSessionSet, CimInstanceComputerSet
274+ Parameter Sets: CimInstanceComputerSet, CimInstanceSessionSet
269275Aliases: CimInstance
270276
271277Required: True
@@ -300,7 +306,7 @@ the local WMI server to provide the list of namespaces.
300306
301307` ` ` yaml
302308Type: System.String
303- Parameter Sets: ClassNameComputerSet, ClassNameSessionSet, ResourceUriComputerSet, ResourceUriSessionSet, QueryComputerSet, QuerySessionSet
309+ Parameter Sets: ClassNameComputerSet, ClassNameSessionSet, ResourceUriComputerSet, ResourceUriSessionSet, QuerySessionSet, QueryComputerSet
304310Aliases:
305311
306312Required: False
@@ -343,7 +349,7 @@ them in square brackets (`[]`): percent (`%`), underscore (`_`), or opening squa
343349
344350` ` ` yaml
345351Type: System.String
346- Parameter Sets: QueryComputerSet, QuerySessionSet
352+ Parameter Sets: QuerySessionSet, QueryComputerSet
347353Aliases:
348354
349355Required: True
@@ -362,7 +368,7 @@ The default value is **WQL**.
362368
363369` ` ` yaml
364370Type: System.String
365- Parameter Sets: QueryComputerSet, QuerySessionSet
371+ Parameter Sets: QuerySessionSet, QueryComputerSet
366372Aliases:
367373
368374Required: False
@@ -398,7 +404,7 @@ parameter is ignored.
398404
399405` ` ` yaml
400406Type: System.Uri
401- Parameter Sets: ResourceUriSessionSet, ResourceUriComputerSet
407+ Parameter Sets: CimInstanceComputerSet, CimInstanceSessionSet
402408Aliases:
403409
404410Required: True (ResourceUriSessionSet, ResourceUriComputerSet), False (CimInstanceSessionSet, CimInstanceComputerSet)
@@ -445,7 +451,7 @@ Accept wildcard characters: False
445451This cmdlet supports the common parameters : -Debug, -ErrorAction, -ErrorVariable,
446452-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose,
447453-WarningAction, and -WarningVariable. For more information, see
448- [about_CommonParameters](../Microsoft.PowerShell.Core/About/about_CommonParameters.md ).
454+ [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216 ).
449455
450456# # INPUTS
451457
0 commit comments