diff --git a/reference/5.1/CimCmdlets/Get-CimClass.md b/reference/5.1/CimCmdlets/Get-CimClass.md index 70639c3994c2..ec0b548d575c 100644 --- a/reference/5.1/CimCmdlets/Get-CimClass.md +++ b/reference/5.1/CimCmdlets/Get-CimClass.md @@ -18,17 +18,17 @@ Gets a list of CIM classes in a specific namespace. ### ComputerSet (Default) ``` -Get-CimClass [[-ClassName] ] [[-Namespace] ] [-OperationTimeoutSec ] - [-ComputerName ] [-MethodName ] [-PropertyName ] - [-QualifierName ] [] +Get-CimClass [[-ClassName] ] [[-Namespace] ] + [-OperationTimeoutSec ] [-ComputerName ] [-MethodName ] + [-PropertyName ] [-QualifierName ] [] ``` ### SessionSet ``` -Get-CimClass [[-ClassName] ] [[-Namespace] ] [-OperationTimeoutSec ] - -CimSession [-MethodName ] [-PropertyName ] - [-QualifierName ] [] +Get-CimClass [[-ClassName] ] [[-Namespace] ] + [-OperationTimeoutSec ] -CimSession [-MethodName ] + [-PropertyName ] [-QualifierName ] [] ``` ## DESCRIPTION diff --git a/reference/5.1/CimCmdlets/Get-CimInstance.md b/reference/5.1/CimCmdlets/Get-CimInstance.md index c778f6606009..545e71aa7b9b 100644 --- a/reference/5.1/CimCmdlets/Get-CimInstance.md +++ b/reference/5.1/CimCmdlets/Get-CimInstance.md @@ -18,17 +18,17 @@ Gets the CIM instances of a class from a CIM server. ### ClassNameComputerSet (Default) ``` -Get-CimInstance [-ClassName] [-ComputerName ] [-KeyOnly] [-Namespace ] - [-OperationTimeoutSec ] [-QueryDialect ] [-Shallow] [-Filter ] - [-Property ] [] +Get-CimInstance [-ClassName] [-ComputerName ] [-KeyOnly] + [-Namespace ] [-OperationTimeoutSec ] [-QueryDialect ] [-Shallow] + [-Filter ] [-Property ] [] ``` ### ResourceUriSessionSet ``` -Get-CimInstance -CimSession -ResourceUri [-KeyOnly] [-Namespace ] - [-OperationTimeoutSec ] [-Shallow] [-Filter ] [-Property ] - [] +Get-CimInstance -CimSession -ResourceUri [-KeyOnly] + [-Namespace ] [-OperationTimeoutSec ] [-Shallow] [-Filter ] + [-Property ] [] ``` ### QuerySessionSet @@ -42,31 +42,31 @@ Get-CimInstance -CimSession [-ResourceUri ] [-Namespace [-ClassName] [-KeyOnly] [-Namespace ] - [-OperationTimeoutSec ] [-QueryDialect ] [-Shallow] [-Filter ] - [-Property ] [] +Get-CimInstance -CimSession [-ClassName] [-KeyOnly] + [-Namespace ] [-OperationTimeoutSec ] [-QueryDialect ] [-Shallow] + [-Filter ] [-Property ] [] ``` ### CimInstanceSessionSet ``` -Get-CimInstance -CimSession [-ResourceUri ] [-OperationTimeoutSec ] - [-InputObject] [] +Get-CimInstance -CimSession [-ResourceUri ] + [-OperationTimeoutSec ] [-InputObject] [] ``` ### CimInstanceComputerSet ``` -Get-CimInstance [-ResourceUri ] [-ComputerName ] [-OperationTimeoutSec ] - [-InputObject] [] +Get-CimInstance [-ResourceUri ] [-ComputerName ] + [-OperationTimeoutSec ] [-InputObject] [] ``` ### ResourceUriComputerSet ``` -Get-CimInstance -ResourceUri [-ComputerName ] [-KeyOnly] [-Namespace ] - [-OperationTimeoutSec ] [-Shallow] [-Filter ] [-Property ] - [] +Get-CimInstance -ResourceUri [-ComputerName ] [-KeyOnly] + [-Namespace ] [-OperationTimeoutSec ] [-Shallow] [-Filter ] + [-Property ] [] ``` ### QueryComputerSet @@ -142,7 +142,16 @@ the key property `@{ "Handle"=0 }` and stores it in a variable named `$x`. The v a CIM instance to the `Get-CimInstance` cmdlet to get a particular instance. ```powershell -$x = New-CimInstance -ClassName Win32_Process -Namespace root\cimv2 -Property @{"Handle"=0} -Key Handle -ClientOnly +$instance = @{ + ClassName = 'Win32_Process' + Namespace = 'root\cimv2' + Properties = @{ + Handle = 0 + } + Key = 'Handle' + ClientOnly = $true +} +$x = New-CimInstance @instance Get-CimInstance -CimInstance $x ``` @@ -153,7 +162,7 @@ the variables `$x` and `$y`. The variable `$x` is then formatted in a table cont **Name** and **KernelModeTime** properties, the table set to **AutoSize**. ```powershell -$x,$y = Get-CimInstance -ClassName Win32_Process +$x, $y = Get-CimInstance -ClassName Win32_Process $x | Format-Table -Property Name, KernelModeTime -AutoSize ``` diff --git a/reference/5.1/CimCmdlets/Get-CimSession.md b/reference/5.1/CimCmdlets/Get-CimSession.md index b1a7ea06c221..e322962136aa 100644 --- a/reference/5.1/CimCmdlets/Get-CimSession.md +++ b/reference/5.1/CimCmdlets/Get-CimSession.md @@ -134,7 +134,7 @@ Protocol : WSMAN This example gets the CIM session that has an **Id** of 2. ```powershell -Get-CimSession -ID 2 +Get-CimSession -Id 2 ``` ```Output diff --git a/reference/5.1/CimCmdlets/Invoke-CimMethod.md b/reference/5.1/CimCmdlets/Invoke-CimMethod.md index da17bffd9036..a603a0d6c453 100644 --- a/reference/5.1/CimCmdlets/Invoke-CimMethod.md +++ b/reference/5.1/CimCmdlets/Invoke-CimMethod.md @@ -18,63 +18,65 @@ Invokes a method of a CIM class. ### ClassNameComputerSet (Default) ``` -Invoke-CimMethod [-ClassName] [-ComputerName ] [[-Arguments] ] - [-MethodName] [-Namespace ] [-OperationTimeoutSec ] [-WhatIf] [-Confirm] - [] +Invoke-CimMethod [-ClassName] [-ComputerName ] + [[-Arguments] ] [-MethodName] [-Namespace ] + [-OperationTimeoutSec ] [-WhatIf] [-Confirm] [] ``` ### ClassNameSessionSet ``` -Invoke-CimMethod [-ClassName] -CimSession [[-Arguments] ] - [-MethodName] [-Namespace ] [-OperationTimeoutSec ] [-WhatIf] [-Confirm] - [] +Invoke-CimMethod [-ClassName] -CimSession + [[-Arguments] ] [-MethodName] [-Namespace ] + [-OperationTimeoutSec ] [-WhatIf] [-Confirm] [] ``` ### ResourceUriComputerSet ``` -Invoke-CimMethod -ResourceUri [-ComputerName ] [[-Arguments] ] - [-MethodName] [-Namespace ] [-OperationTimeoutSec ] [-WhatIf] [-Confirm] - [] +Invoke-CimMethod -ResourceUri [-ComputerName ] + [[-Arguments] ] [-MethodName] [-Namespace ] + [-OperationTimeoutSec ] [-WhatIf] [-Confirm] [] ``` ### CimInstanceSessionSet ``` -Invoke-CimMethod [-ResourceUri ] [-InputObject] -CimSession - [[-Arguments] ] [-MethodName] [-OperationTimeoutSec ] [-WhatIf] - [-Confirm] [] +Invoke-CimMethod [-ResourceUri ] [-InputObject] + -CimSession [[-Arguments] ] [-MethodName] + [-OperationTimeoutSec ] [-WhatIf] [-Confirm] [] ``` ### CimInstanceComputerSet ``` -Invoke-CimMethod [-ResourceUri ] [-InputObject] [-ComputerName ] - [[-Arguments] ] [-MethodName] [-OperationTimeoutSec ] [-WhatIf] - [-Confirm] [] +Invoke-CimMethod [-ResourceUri ] [-InputObject] + [-ComputerName ] [[-Arguments] ] [-MethodName] + [-OperationTimeoutSec ] [-WhatIf] [-Confirm] [] ``` ### ResourceUriSessionSet ``` -Invoke-CimMethod -ResourceUri -CimSession [[-Arguments] ] - [-MethodName] [-Namespace ] [-OperationTimeoutSec ] [-WhatIf] [-Confirm] - [] +Invoke-CimMethod -ResourceUri -CimSession + [[-Arguments] ] [-MethodName] [-Namespace ] + [-OperationTimeoutSec ] [-WhatIf] [-Confirm] [] ``` ### CimClassComputerSet ``` -Invoke-CimMethod [-CimClass] [-ComputerName ] [[-Arguments] ] - [-MethodName] [-OperationTimeoutSec ] [-WhatIf] [-Confirm] [] +Invoke-CimMethod [-CimClass] [-ComputerName ] + [[-Arguments] ] [-MethodName] [-OperationTimeoutSec ] + [-WhatIf] [-Confirm] [] ``` ### CimClassSessionSet ``` -Invoke-CimMethod [-CimClass] -CimSession [[-Arguments] ] - [-MethodName] [-OperationTimeoutSec ] [-WhatIf] [-Confirm] [] +Invoke-CimMethod [-CimClass] -CimSession + [[-Arguments] ] [-MethodName] [-OperationTimeoutSec ] + [-WhatIf] [-Confirm] [] ``` ### QueryComputerSet @@ -122,7 +124,11 @@ If the **InputObject** parameter is specified, the cmdlet works in one of the fo This example invokes the **Terminate** method of the **Win32_Process** class. ```powershell -Invoke-CimMethod -Query 'select * from Win32_Process where name like "notepad%"' -MethodName "Terminate" +$method = @{ + Query = 'select * from Win32_Process where name like "notepad%"' + MethodName = "Terminate" +} +Invoke-CimMethod @method ``` ### 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 ```yaml Type: Microsoft.Management.Infrastructure.CimInstance -Parameter Sets: CimInstanceSessionSet, CimInstanceComputerSet +Parameter Sets: CimInstanceComputerSet, CimInstanceSessionSet Aliases: CimInstance Required: True @@ -300,7 +306,7 @@ the local WMI server to provide the list of namespaces. ```yaml Type: System.String -Parameter Sets: ClassNameComputerSet, ClassNameSessionSet, ResourceUriComputerSet, ResourceUriSessionSet, QueryComputerSet, QuerySessionSet +Parameter Sets: ClassNameComputerSet, ClassNameSessionSet, ResourceUriComputerSet, ResourceUriSessionSet, QuerySessionSet, QueryComputerSet Aliases: Required: False @@ -343,7 +349,7 @@ them in square brackets (`[]`): percent (`%`), underscore (`_`), or opening squa ```yaml Type: System.String -Parameter Sets: QueryComputerSet, QuerySessionSet +Parameter Sets: QuerySessionSet, QueryComputerSet Aliases: Required: True @@ -362,7 +368,7 @@ The default value is **WQL**. ```yaml Type: System.String -Parameter Sets: QueryComputerSet, QuerySessionSet +Parameter Sets: QuerySessionSet, QueryComputerSet Aliases: Required: False @@ -398,7 +404,7 @@ parameter is ignored. ```yaml Type: System.Uri -Parameter Sets: ResourceUriSessionSet, ResourceUriComputerSet +Parameter Sets: CimInstanceComputerSet, CimInstanceSessionSet Aliases: Required: True (ResourceUriSessionSet, ResourceUriComputerSet), False (CimInstanceSessionSet, CimInstanceComputerSet) @@ -445,7 +451,7 @@ 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](../Microsoft.PowerShell.Core/About/about_CommonParameters.md). +[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/reference/7.4/CimCmdlets/Get-CimClass.md b/reference/7.4/CimCmdlets/Get-CimClass.md index e6af32303167..22c6b7d2f56e 100644 --- a/reference/7.4/CimCmdlets/Get-CimClass.md +++ b/reference/7.4/CimCmdlets/Get-CimClass.md @@ -26,8 +26,8 @@ Get-CimClass [[-ClassName] ] [[-Namespace] ] [-Amended] ### SessionSet ``` -Get-CimClass [[-ClassName] ] [[-Namespace] ] -CimSession [-Amended] - [-OperationTimeoutSec ] [-MethodName ] [-PropertyName ] +Get-CimClass [[-ClassName] ] [[-Namespace] ] -CimSession + [-Amended] [-OperationTimeoutSec ] [-MethodName ] [-PropertyName ] [-QualifierName ] [] ``` diff --git a/reference/7.4/CimCmdlets/Get-CimInstance.md b/reference/7.4/CimCmdlets/Get-CimInstance.md index 78befd6d3ca7..bb4b5ae21898 100644 --- a/reference/7.4/CimCmdlets/Get-CimInstance.md +++ b/reference/7.4/CimCmdlets/Get-CimInstance.md @@ -18,17 +18,17 @@ Gets the CIM instances of a class from a CIM server. ### ClassNameComputerSet (Default) ``` -Get-CimInstance [-ClassName] [-ComputerName ] [-KeyOnly] [-Namespace ] - [-OperationTimeoutSec ] [-QueryDialect ] [-Shallow] [-Filter ] - [-Property ] [] +Get-CimInstance [-ClassName] [-ComputerName ] [-KeyOnly] + [-Namespace ] [-OperationTimeoutSec ] [-QueryDialect ] [-Shallow] + [-Filter ] [-Property ] [] ``` ### ResourceUriSessionSet ``` -Get-CimInstance -CimSession -ResourceUri [-KeyOnly] [-Namespace ] - [-OperationTimeoutSec ] [-Shallow] [-Filter ] [-Property ] - [] +Get-CimInstance -CimSession -ResourceUri [-KeyOnly] + [-Namespace ] [-OperationTimeoutSec ] [-Shallow] [-Filter ] + [-Property ] [] ``` ### QuerySessionSet @@ -42,31 +42,31 @@ Get-CimInstance -CimSession [-ResourceUri ] [-Namespace [-ClassName] [-KeyOnly] [-Namespace ] - [-OperationTimeoutSec ] [-QueryDialect ] [-Shallow] [-Filter ] - [-Property ] [] +Get-CimInstance -CimSession [-ClassName] [-KeyOnly] + [-Namespace ] [-OperationTimeoutSec ] [-QueryDialect ] [-Shallow] + [-Filter ] [-Property ] [] ``` ### CimInstanceSessionSet ``` -Get-CimInstance -CimSession [-ResourceUri ] [-OperationTimeoutSec ] - [-InputObject] [] +Get-CimInstance -CimSession [-ResourceUri ] + [-OperationTimeoutSec ] [-InputObject] [] ``` ### CimInstanceComputerSet ``` -Get-CimInstance [-ResourceUri ] [-ComputerName ] [-OperationTimeoutSec ] - [-InputObject] [] +Get-CimInstance [-ResourceUri ] [-ComputerName ] + [-OperationTimeoutSec ] [-InputObject] [] ``` ### ResourceUriComputerSet ``` -Get-CimInstance -ResourceUri [-ComputerName ] [-KeyOnly] [-Namespace ] - [-OperationTimeoutSec ] [-Shallow] [-Filter ] [-Property ] - [] +Get-CimInstance -ResourceUri [-ComputerName ] [-KeyOnly] + [-Namespace ] [-OperationTimeoutSec ] [-Shallow] [-Filter ] + [-Property ] [] ``` ### QueryComputerSet @@ -144,7 +144,16 @@ the key property `@{ "Handle"=0 }` and stores it in a variable named `$x`. The v a CIM instance to the `Get-CimInstance` cmdlet to get a particular instance. ```powershell -$x = New-CimInstance -ClassName Win32_Process -Namespace root\cimv2 -Property @{"Handle"=0} -Key Handle -ClientOnly +$instance = @{ + ClassName = 'Win32_Process' + Namespace = 'root\cimv2' + Properties = @{ + Handle = 0 + } + Key = 'Handle' + ClientOnly = $true +} +$x = New-CimInstance @instance Get-CimInstance -CimInstance $x ``` @@ -155,7 +164,7 @@ the variables `$x` and `$y`. The variable `$x` is then formatted in a table cont **Name** and **KernelModeTime** properties, the table set to **AutoSize**. ```powershell -$x,$y = Get-CimInstance -ClassName Win32_Process +$x, $y = Get-CimInstance -ClassName Win32_Process $x | Format-Table -Property Name, KernelModeTime -AutoSize ``` diff --git a/reference/7.4/CimCmdlets/Get-CimSession.md b/reference/7.4/CimCmdlets/Get-CimSession.md index 67433362ce4b..cc4255be2acf 100644 --- a/reference/7.4/CimCmdlets/Get-CimSession.md +++ b/reference/7.4/CimCmdlets/Get-CimSession.md @@ -136,7 +136,7 @@ Protocol : WSMAN This example gets the CIM session that has an **Id** of 2. ```powershell -Get-CimSession -ID 2 +Get-CimSession -Id 2 ``` ```Output diff --git a/reference/7.4/CimCmdlets/Invoke-CimMethod.md b/reference/7.4/CimCmdlets/Invoke-CimMethod.md index f9dcb897741d..84c33f408679 100644 --- a/reference/7.4/CimCmdlets/Invoke-CimMethod.md +++ b/reference/7.4/CimCmdlets/Invoke-CimMethod.md @@ -18,63 +18,65 @@ Invokes a method of a CIM class. ### ClassNameComputerSet (Default) ``` -Invoke-CimMethod [-ClassName] [-ComputerName ] [[-Arguments] ] - [-MethodName] [-Namespace ] [-OperationTimeoutSec ] [-WhatIf] [-Confirm] - [] +Invoke-CimMethod [-ClassName] [-ComputerName ] + [[-Arguments] ] [-MethodName] [-Namespace ] + [-OperationTimeoutSec ] [-WhatIf] [-Confirm] [] ``` ### ClassNameSessionSet ``` -Invoke-CimMethod [-ClassName] -CimSession [[-Arguments] ] - [-MethodName] [-Namespace ] [-OperationTimeoutSec ] [-WhatIf] [-Confirm] - [] +Invoke-CimMethod [-ClassName] -CimSession + [[-Arguments] ] [-MethodName] [-Namespace ] + [-OperationTimeoutSec ] [-WhatIf] [-Confirm] [] ``` ### ResourceUriComputerSet ``` -Invoke-CimMethod -ResourceUri [-ComputerName ] [[-Arguments] ] - [-MethodName] [-Namespace ] [-OperationTimeoutSec ] [-WhatIf] [-Confirm] - [] +Invoke-CimMethod -ResourceUri [-ComputerName ] + [[-Arguments] ] [-MethodName] [-Namespace ] + [-OperationTimeoutSec ] [-WhatIf] [-Confirm] [] ``` ### CimInstanceSessionSet ``` -Invoke-CimMethod [-ResourceUri ] [-InputObject] -CimSession - [[-Arguments] ] [-MethodName] [-OperationTimeoutSec ] [-WhatIf] - [-Confirm] [] +Invoke-CimMethod [-ResourceUri ] [-InputObject] + -CimSession [[-Arguments] ] [-MethodName] + [-OperationTimeoutSec ] [-WhatIf] [-Confirm] [] ``` ### CimInstanceComputerSet ``` -Invoke-CimMethod [-ResourceUri ] [-InputObject] [-ComputerName ] - [[-Arguments] ] [-MethodName] [-OperationTimeoutSec ] [-WhatIf] - [-Confirm] [] +Invoke-CimMethod [-ResourceUri ] [-InputObject] + [-ComputerName ] [[-Arguments] ] [-MethodName] + [-OperationTimeoutSec ] [-WhatIf] [-Confirm] [] ``` ### ResourceUriSessionSet ``` -Invoke-CimMethod -ResourceUri -CimSession [[-Arguments] ] - [-MethodName] [-Namespace ] [-OperationTimeoutSec ] [-WhatIf] [-Confirm] - [] +Invoke-CimMethod -ResourceUri -CimSession + [[-Arguments] ] [-MethodName] [-Namespace ] + [-OperationTimeoutSec ] [-WhatIf] [-Confirm] [] ``` ### CimClassComputerSet ``` -Invoke-CimMethod [-CimClass] [-ComputerName ] [[-Arguments] ] - [-MethodName] [-OperationTimeoutSec ] [-WhatIf] [-Confirm] [] +Invoke-CimMethod [-CimClass] [-ComputerName ] + [[-Arguments] ] [-MethodName] [-OperationTimeoutSec ] + [-WhatIf] [-Confirm] [] ``` ### CimClassSessionSet ``` -Invoke-CimMethod [-CimClass] -CimSession [[-Arguments] ] - [-MethodName] [-OperationTimeoutSec ] [-WhatIf] [-Confirm] [] +Invoke-CimMethod [-CimClass] -CimSession + [[-Arguments] ] [-MethodName] [-OperationTimeoutSec ] + [-WhatIf] [-Confirm] [] ``` ### QueryComputerSet @@ -124,7 +126,11 @@ If the **InputObject** parameter is specified, the cmdlet works in one of the fo This example invokes the **Terminate** method of the **Win32_Process** class. ```powershell -Invoke-CimMethod -Query 'select * from Win32_Process where name like "notepad%"' -MethodName "Terminate" +$method = @{ + Query = 'select * from Win32_Process where name like "notepad%"' + MethodName = "Terminate" +} +Invoke-CimMethod @method ``` ### Example 2: Invoke a method using CIM instance object @@ -447,7 +453,7 @@ 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](../Microsoft.PowerShell.Core/About/about_CommonParameters.md). +[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/reference/7.5/CimCmdlets/Get-CimClass.md b/reference/7.5/CimCmdlets/Get-CimClass.md index 575d0834b325..0f7a07eebbf3 100644 --- a/reference/7.5/CimCmdlets/Get-CimClass.md +++ b/reference/7.5/CimCmdlets/Get-CimClass.md @@ -26,8 +26,8 @@ Get-CimClass [[-ClassName] ] [[-Namespace] ] [-Amended] ### SessionSet ``` -Get-CimClass [[-ClassName] ] [[-Namespace] ] -CimSession [-Amended] - [-OperationTimeoutSec ] [-MethodName ] [-PropertyName ] +Get-CimClass [[-ClassName] ] [[-Namespace] ] -CimSession + [-Amended] [-OperationTimeoutSec ] [-MethodName ] [-PropertyName ] [-QualifierName ] [] ``` diff --git a/reference/7.5/CimCmdlets/Get-CimInstance.md b/reference/7.5/CimCmdlets/Get-CimInstance.md index 7387fa02bf6f..744558ac75c3 100644 --- a/reference/7.5/CimCmdlets/Get-CimInstance.md +++ b/reference/7.5/CimCmdlets/Get-CimInstance.md @@ -18,17 +18,17 @@ Gets the CIM instances of a class from a CIM server. ### ClassNameComputerSet (Default) ``` -Get-CimInstance [-ClassName] [-ComputerName ] [-KeyOnly] [-Namespace ] - [-OperationTimeoutSec ] [-QueryDialect ] [-Shallow] [-Filter ] - [-Property ] [] +Get-CimInstance [-ClassName] [-ComputerName ] [-KeyOnly] + [-Namespace ] [-OperationTimeoutSec ] [-QueryDialect ] [-Shallow] + [-Filter ] [-Property ] [] ``` ### ResourceUriSessionSet ``` -Get-CimInstance -CimSession -ResourceUri [-KeyOnly] [-Namespace ] - [-OperationTimeoutSec ] [-Shallow] [-Filter ] [-Property ] - [] +Get-CimInstance -CimSession -ResourceUri [-KeyOnly] + [-Namespace ] [-OperationTimeoutSec ] [-Shallow] [-Filter ] + [-Property ] [] ``` ### QuerySessionSet @@ -42,31 +42,31 @@ Get-CimInstance -CimSession [-ResourceUri ] [-Namespace [-ClassName] [-KeyOnly] [-Namespace ] - [-OperationTimeoutSec ] [-QueryDialect ] [-Shallow] [-Filter ] - [-Property ] [] +Get-CimInstance -CimSession [-ClassName] [-KeyOnly] + [-Namespace ] [-OperationTimeoutSec ] [-QueryDialect ] [-Shallow] + [-Filter ] [-Property ] [] ``` ### CimInstanceSessionSet ``` -Get-CimInstance -CimSession [-ResourceUri ] [-OperationTimeoutSec ] - [-InputObject] [] +Get-CimInstance -CimSession [-ResourceUri ] + [-OperationTimeoutSec ] [-InputObject] [] ``` ### CimInstanceComputerSet ``` -Get-CimInstance [-ResourceUri ] [-ComputerName ] [-OperationTimeoutSec ] - [-InputObject] [] +Get-CimInstance [-ResourceUri ] [-ComputerName ] + [-OperationTimeoutSec ] [-InputObject] [] ``` ### ResourceUriComputerSet ``` -Get-CimInstance -ResourceUri [-ComputerName ] [-KeyOnly] [-Namespace ] - [-OperationTimeoutSec ] [-Shallow] [-Filter ] [-Property ] - [] +Get-CimInstance -ResourceUri [-ComputerName ] [-KeyOnly] + [-Namespace ] [-OperationTimeoutSec ] [-Shallow] [-Filter ] + [-Property ] [] ``` ### QueryComputerSet @@ -144,7 +144,16 @@ the key property `@{ "Handle"=0 }` and stores it in a variable named `$x`. The v a CIM instance to the `Get-CimInstance` cmdlet to get a particular instance. ```powershell -$x = New-CimInstance -ClassName Win32_Process -Namespace root\cimv2 -Property @{"Handle"=0} -Key Handle -ClientOnly +$instance = @{ + ClassName = 'Win32_Process' + Namespace = 'root\cimv2' + Properties = @{ + Handle = 0 + } + Key = 'Handle' + ClientOnly = $true +} +$x = New-CimInstance @instance Get-CimInstance -CimInstance $x ``` @@ -155,7 +164,7 @@ the variables `$x` and `$y`. The variable `$x` is then formatted in a table cont **Name** and **KernelModeTime** properties, the table set to **AutoSize**. ```powershell -$x,$y = Get-CimInstance -ClassName Win32_Process +$x, $y = Get-CimInstance -ClassName Win32_Process $x | Format-Table -Property Name, KernelModeTime -AutoSize ``` diff --git a/reference/7.5/CimCmdlets/Get-CimSession.md b/reference/7.5/CimCmdlets/Get-CimSession.md index 4c81ea011d87..8e3fbf728712 100644 --- a/reference/7.5/CimCmdlets/Get-CimSession.md +++ b/reference/7.5/CimCmdlets/Get-CimSession.md @@ -136,7 +136,7 @@ Protocol : WSMAN This example gets the CIM session that has an **Id** of 2. ```powershell -Get-CimSession -ID 2 +Get-CimSession -Id 2 ``` ```Output diff --git a/reference/7.5/CimCmdlets/Invoke-CimMethod.md b/reference/7.5/CimCmdlets/Invoke-CimMethod.md index 4d711ae23cf2..8e86a4d50291 100644 --- a/reference/7.5/CimCmdlets/Invoke-CimMethod.md +++ b/reference/7.5/CimCmdlets/Invoke-CimMethod.md @@ -18,63 +18,65 @@ Invokes a method of a CIM class. ### ClassNameComputerSet (Default) ``` -Invoke-CimMethod [-ClassName] [-ComputerName ] [[-Arguments] ] - [-MethodName] [-Namespace ] [-OperationTimeoutSec ] [-WhatIf] [-Confirm] - [] +Invoke-CimMethod [-ClassName] [-ComputerName ] + [[-Arguments] ] [-MethodName] [-Namespace ] + [-OperationTimeoutSec ] [-WhatIf] [-Confirm] [] ``` ### ClassNameSessionSet ``` -Invoke-CimMethod [-ClassName] -CimSession [[-Arguments] ] - [-MethodName] [-Namespace ] [-OperationTimeoutSec ] [-WhatIf] [-Confirm] - [] +Invoke-CimMethod [-ClassName] -CimSession + [[-Arguments] ] [-MethodName] [-Namespace ] + [-OperationTimeoutSec ] [-WhatIf] [-Confirm] [] ``` ### ResourceUriComputerSet ``` -Invoke-CimMethod -ResourceUri [-ComputerName ] [[-Arguments] ] - [-MethodName] [-Namespace ] [-OperationTimeoutSec ] [-WhatIf] [-Confirm] - [] +Invoke-CimMethod -ResourceUri [-ComputerName ] + [[-Arguments] ] [-MethodName] [-Namespace ] + [-OperationTimeoutSec ] [-WhatIf] [-Confirm] [] ``` ### CimInstanceSessionSet ``` -Invoke-CimMethod [-ResourceUri ] [-InputObject] -CimSession - [[-Arguments] ] [-MethodName] [-OperationTimeoutSec ] [-WhatIf] - [-Confirm] [] +Invoke-CimMethod [-ResourceUri ] [-InputObject] + -CimSession [[-Arguments] ] [-MethodName] + [-OperationTimeoutSec ] [-WhatIf] [-Confirm] [] ``` ### CimInstanceComputerSet ``` -Invoke-CimMethod [-ResourceUri ] [-InputObject] [-ComputerName ] - [[-Arguments] ] [-MethodName] [-OperationTimeoutSec ] [-WhatIf] - [-Confirm] [] +Invoke-CimMethod [-ResourceUri ] [-InputObject] + [-ComputerName ] [[-Arguments] ] [-MethodName] + [-OperationTimeoutSec ] [-WhatIf] [-Confirm] [] ``` ### ResourceUriSessionSet ``` -Invoke-CimMethod -ResourceUri -CimSession [[-Arguments] ] - [-MethodName] [-Namespace ] [-OperationTimeoutSec ] [-WhatIf] [-Confirm] - [] +Invoke-CimMethod -ResourceUri -CimSession + [[-Arguments] ] [-MethodName] [-Namespace ] + [-OperationTimeoutSec ] [-WhatIf] [-Confirm] [] ``` ### CimClassComputerSet ``` -Invoke-CimMethod [-CimClass] [-ComputerName ] [[-Arguments] ] - [-MethodName] [-OperationTimeoutSec ] [-WhatIf] [-Confirm] [] +Invoke-CimMethod [-CimClass] [-ComputerName ] + [[-Arguments] ] [-MethodName] [-OperationTimeoutSec ] + [-WhatIf] [-Confirm] [] ``` ### CimClassSessionSet ``` -Invoke-CimMethod [-CimClass] -CimSession [[-Arguments] ] - [-MethodName] [-OperationTimeoutSec ] [-WhatIf] [-Confirm] [] +Invoke-CimMethod [-CimClass] -CimSession + [[-Arguments] ] [-MethodName] [-OperationTimeoutSec ] + [-WhatIf] [-Confirm] [] ``` ### QueryComputerSet @@ -124,7 +126,11 @@ If the **InputObject** parameter is specified, the cmdlet works in one of the fo This example invokes the **Terminate** method of the **Win32_Process** class. ```powershell -Invoke-CimMethod -Query 'select * from Win32_Process where name like "notepad%"' -MethodName "Terminate" +$method = @{ + Query = 'select * from Win32_Process where name like "notepad%"' + MethodName = "Terminate" +} +Invoke-CimMethod @method ``` ### Example 2: Invoke a method using CIM instance object @@ -447,7 +453,7 @@ 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](../Microsoft.PowerShell.Core/About/about_CommonParameters.md). +[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/reference/7.6/CimCmdlets/Get-CimClass.md b/reference/7.6/CimCmdlets/Get-CimClass.md index 3994f76e5a0c..adc9d5fce212 100644 --- a/reference/7.6/CimCmdlets/Get-CimClass.md +++ b/reference/7.6/CimCmdlets/Get-CimClass.md @@ -26,8 +26,8 @@ Get-CimClass [[-ClassName] ] [[-Namespace] ] [-Amended] ### SessionSet ``` -Get-CimClass [[-ClassName] ] [[-Namespace] ] -CimSession [-Amended] - [-OperationTimeoutSec ] [-MethodName ] [-PropertyName ] +Get-CimClass [[-ClassName] ] [[-Namespace] ] -CimSession + [-Amended] [-OperationTimeoutSec ] [-MethodName ] [-PropertyName ] [-QualifierName ] [] ``` diff --git a/reference/7.6/CimCmdlets/Get-CimInstance.md b/reference/7.6/CimCmdlets/Get-CimInstance.md index 7c2c9612eabd..cbb4f6790d32 100644 --- a/reference/7.6/CimCmdlets/Get-CimInstance.md +++ b/reference/7.6/CimCmdlets/Get-CimInstance.md @@ -18,17 +18,17 @@ Gets the CIM instances of a class from a CIM server. ### ClassNameComputerSet (Default) ``` -Get-CimInstance [-ClassName] [-ComputerName ] [-KeyOnly] [-Namespace ] - [-OperationTimeoutSec ] [-QueryDialect ] [-Shallow] [-Filter ] - [-Property ] [] +Get-CimInstance [-ClassName] [-ComputerName ] [-KeyOnly] + [-Namespace ] [-OperationTimeoutSec ] [-QueryDialect ] [-Shallow] + [-Filter ] [-Property ] [] ``` ### ResourceUriSessionSet ``` -Get-CimInstance -CimSession -ResourceUri [-KeyOnly] [-Namespace ] - [-OperationTimeoutSec ] [-Shallow] [-Filter ] [-Property ] - [] +Get-CimInstance -CimSession -ResourceUri [-KeyOnly] + [-Namespace ] [-OperationTimeoutSec ] [-Shallow] [-Filter ] + [-Property ] [] ``` ### QuerySessionSet @@ -42,31 +42,31 @@ Get-CimInstance -CimSession [-ResourceUri ] [-Namespace [-ClassName] [-KeyOnly] [-Namespace ] - [-OperationTimeoutSec ] [-QueryDialect ] [-Shallow] [-Filter ] - [-Property ] [] +Get-CimInstance -CimSession [-ClassName] [-KeyOnly] + [-Namespace ] [-OperationTimeoutSec ] [-QueryDialect ] [-Shallow] + [-Filter ] [-Property ] [] ``` ### CimInstanceSessionSet ``` -Get-CimInstance -CimSession [-ResourceUri ] [-OperationTimeoutSec ] - [-InputObject] [] +Get-CimInstance -CimSession [-ResourceUri ] + [-OperationTimeoutSec ] [-InputObject] [] ``` ### CimInstanceComputerSet ``` -Get-CimInstance [-ResourceUri ] [-ComputerName ] [-OperationTimeoutSec ] - [-InputObject] [] +Get-CimInstance [-ResourceUri ] [-ComputerName ] + [-OperationTimeoutSec ] [-InputObject] [] ``` ### ResourceUriComputerSet ``` -Get-CimInstance -ResourceUri [-ComputerName ] [-KeyOnly] [-Namespace ] - [-OperationTimeoutSec ] [-Shallow] [-Filter ] [-Property ] - [] +Get-CimInstance -ResourceUri [-ComputerName ] [-KeyOnly] + [-Namespace ] [-OperationTimeoutSec ] [-Shallow] [-Filter ] + [-Property ] [] ``` ### QueryComputerSet @@ -144,7 +144,16 @@ the key property `@{ "Handle"=0 }` and stores it in a variable named `$x`. The v a CIM instance to the `Get-CimInstance` cmdlet to get a particular instance. ```powershell -$x = New-CimInstance -ClassName Win32_Process -Namespace root\cimv2 -Property @{"Handle"=0} -Key Handle -ClientOnly +$instance = @{ + ClassName = 'Win32_Process' + Namespace = 'root\cimv2' + Properties = @{ + Handle = 0 + } + Key = 'Handle' + ClientOnly = $true +} +$x = New-CimInstance @instance Get-CimInstance -CimInstance $x ``` @@ -155,7 +164,7 @@ the variables `$x` and `$y`. The variable `$x` is then formatted in a table cont **Name** and **KernelModeTime** properties, the table set to **AutoSize**. ```powershell -$x,$y = Get-CimInstance -ClassName Win32_Process +$x, $y = Get-CimInstance -ClassName Win32_Process $x | Format-Table -Property Name, KernelModeTime -AutoSize ``` diff --git a/reference/7.6/CimCmdlets/Get-CimSession.md b/reference/7.6/CimCmdlets/Get-CimSession.md index 3d85f2b62b4a..30c7e5dddcef 100644 --- a/reference/7.6/CimCmdlets/Get-CimSession.md +++ b/reference/7.6/CimCmdlets/Get-CimSession.md @@ -136,7 +136,7 @@ Protocol : WSMAN This example gets the CIM session that has an **Id** of 2. ```powershell -Get-CimSession -ID 2 +Get-CimSession -Id 2 ``` ```Output diff --git a/reference/7.6/CimCmdlets/Invoke-CimMethod.md b/reference/7.6/CimCmdlets/Invoke-CimMethod.md index 6de5e28fb553..792c45072c90 100644 --- a/reference/7.6/CimCmdlets/Invoke-CimMethod.md +++ b/reference/7.6/CimCmdlets/Invoke-CimMethod.md @@ -18,63 +18,65 @@ Invokes a method of a CIM class. ### ClassNameComputerSet (Default) ``` -Invoke-CimMethod [-ClassName] [-ComputerName ] [[-Arguments] ] - [-MethodName] [-Namespace ] [-OperationTimeoutSec ] [-WhatIf] [-Confirm] - [] +Invoke-CimMethod [-ClassName] [-ComputerName ] + [[-Arguments] ] [-MethodName] [-Namespace ] + [-OperationTimeoutSec ] [-WhatIf] [-Confirm] [] ``` ### ClassNameSessionSet ``` -Invoke-CimMethod [-ClassName] -CimSession [[-Arguments] ] - [-MethodName] [-Namespace ] [-OperationTimeoutSec ] [-WhatIf] [-Confirm] - [] +Invoke-CimMethod [-ClassName] -CimSession + [[-Arguments] ] [-MethodName] [-Namespace ] + [-OperationTimeoutSec ] [-WhatIf] [-Confirm] [] ``` ### ResourceUriComputerSet ``` -Invoke-CimMethod -ResourceUri [-ComputerName ] [[-Arguments] ] - [-MethodName] [-Namespace ] [-OperationTimeoutSec ] [-WhatIf] [-Confirm] - [] +Invoke-CimMethod -ResourceUri [-ComputerName ] + [[-Arguments] ] [-MethodName] [-Namespace ] + [-OperationTimeoutSec ] [-WhatIf] [-Confirm] [] ``` ### CimInstanceSessionSet ``` -Invoke-CimMethod [-ResourceUri ] [-InputObject] -CimSession - [[-Arguments] ] [-MethodName] [-OperationTimeoutSec ] [-WhatIf] - [-Confirm] [] +Invoke-CimMethod [-ResourceUri ] [-InputObject] + -CimSession [[-Arguments] ] [-MethodName] + [-OperationTimeoutSec ] [-WhatIf] [-Confirm] [] ``` ### CimInstanceComputerSet ``` -Invoke-CimMethod [-ResourceUri ] [-InputObject] [-ComputerName ] - [[-Arguments] ] [-MethodName] [-OperationTimeoutSec ] [-WhatIf] - [-Confirm] [] +Invoke-CimMethod [-ResourceUri ] [-InputObject] + [-ComputerName ] [[-Arguments] ] [-MethodName] + [-OperationTimeoutSec ] [-WhatIf] [-Confirm] [] ``` ### ResourceUriSessionSet ``` -Invoke-CimMethod -ResourceUri -CimSession [[-Arguments] ] - [-MethodName] [-Namespace ] [-OperationTimeoutSec ] [-WhatIf] [-Confirm] - [] +Invoke-CimMethod -ResourceUri -CimSession + [[-Arguments] ] [-MethodName] [-Namespace ] + [-OperationTimeoutSec ] [-WhatIf] [-Confirm] [] ``` ### CimClassComputerSet ``` -Invoke-CimMethod [-CimClass] [-ComputerName ] [[-Arguments] ] - [-MethodName] [-OperationTimeoutSec ] [-WhatIf] [-Confirm] [] +Invoke-CimMethod [-CimClass] [-ComputerName ] + [[-Arguments] ] [-MethodName] [-OperationTimeoutSec ] + [-WhatIf] [-Confirm] [] ``` ### CimClassSessionSet ``` -Invoke-CimMethod [-CimClass] -CimSession [[-Arguments] ] - [-MethodName] [-OperationTimeoutSec ] [-WhatIf] [-Confirm] [] +Invoke-CimMethod [-CimClass] -CimSession + [[-Arguments] ] [-MethodName] [-OperationTimeoutSec ] + [-WhatIf] [-Confirm] [] ``` ### QueryComputerSet @@ -124,7 +126,11 @@ If the **InputObject** parameter is specified, the cmdlet works in one of the fo This example invokes the **Terminate** method of the **Win32_Process** class. ```powershell -Invoke-CimMethod -Query 'select * from Win32_Process where name like "notepad%"' -MethodName "Terminate" +$method = @{ + Query = 'select * from Win32_Process where name like "notepad%"' + MethodName = "Terminate" +} +Invoke-CimMethod @method ``` ### Example 2: Invoke a method using CIM instance object @@ -447,7 +453,7 @@ 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](../Microsoft.PowerShell.Core/About/about_CommonParameters.md). +[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS