Skip to content

Commit 342e325

Browse files
authored
Merge pull request #11813 from MicrosoftDocs/main
2/18/2025 PM Publish
2 parents 317a70b + 0051103 commit 342e325

37 files changed

+661
-343
lines changed

reference/5.1/CimCmdlets/New-CimInstance.md

Lines changed: 37 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -19,46 +19,48 @@ Creates a CIM instance.
1919

2020
```
2121
New-CimInstance [-ClassName] <String> [-Key <String[]>] [[-Property] <IDictionary>]
22-
[-Namespace <String>] [-OperationTimeoutSec <UInt32>] [-ComputerName <String[]>] [-ClientOnly]
23-
[-WhatIf] [-Confirm] [<CommonParameters>]
22+
[-Namespace <String>] [-OperationTimeoutSec <UInt32>] [-ComputerName <String[]>]
23+
[-ClientOnly] [-WhatIf] [-Confirm] [<CommonParameters>]
2424
```
2525

2626
### ClassNameSessionSet
2727

2828
```
2929
New-CimInstance [-ClassName] <String> [-Key <String[]>] [[-Property] <IDictionary>]
30-
[-Namespace <String>] [-OperationTimeoutSec <UInt32>] -CimSession <CimSession[]> [-ClientOnly]
31-
[-WhatIf] [-Confirm] [<CommonParameters>]
30+
[-Namespace <String>] [-OperationTimeoutSec <UInt32>] -CimSession <CimSession[]>
31+
[-ClientOnly] [-WhatIf] [-Confirm] [<CommonParameters>]
3232
```
3333

3434
### ResourceUriSessionSet
3535

3636
```
3737
New-CimInstance -ResourceUri <Uri> [-Key <String[]>] [[-Property] <IDictionary>]
38-
[-Namespace <String>] [-OperationTimeoutSec <UInt32>] -CimSession <CimSession[]> [-WhatIf]
39-
[-Confirm] [<CommonParameters>]
38+
[-Namespace <String>] [-OperationTimeoutSec <UInt32>] -CimSession <CimSession[]>
39+
[-WhatIf] [-Confirm] [<CommonParameters>]
4040
```
4141

4242
### ResourceUriComputerSet
4343

4444
```
4545
New-CimInstance -ResourceUri <Uri> [-Key <String[]>] [[-Property] <IDictionary>]
46-
[-Namespace <String>] [-OperationTimeoutSec <UInt32>] [-ComputerName <String[]>] [-WhatIf]
47-
[-Confirm] [<CommonParameters>]
46+
[-Namespace <String>] [-OperationTimeoutSec <UInt32>] [-ComputerName <String[]>]
47+
[-WhatIf] [-Confirm] [<CommonParameters>]
4848
```
4949

5050
### CimClassSessionSet
5151

5252
```
53-
New-CimInstance [-CimClass] <CimClass> [[-Property] <IDictionary>] [-OperationTimeoutSec <UInt32>]
54-
-CimSession <CimSession[]> [-ClientOnly] [-WhatIf] [-Confirm] [<CommonParameters>]
53+
New-CimInstance [-CimClass] <CimClass> [[-Property] <IDictionary>]
54+
[-OperationTimeoutSec <UInt32>] -CimSession <CimSession[]> [-ClientOnly] [-WhatIf]
55+
[-Confirm] [<CommonParameters>]
5556
```
5657

5758
### CimClassComputerSet
5859

5960
```
60-
New-CimInstance [-CimClass] <CimClass> [[-Property] <IDictionary>] [-OperationTimeoutSec <UInt32>]
61-
[-ComputerName <String[]>] [-ClientOnly] [-WhatIf] [-Confirm] [<CommonParameters>]
61+
New-CimInstance [-CimClass] <CimClass> [[-Property] <IDictionary>]
62+
[-OperationTimeoutSec <UInt32>] [-ComputerName <String[]>] [-ClientOnly] [-WhatIf]
63+
[-Confirm] [<CommonParameters>]
6264
```
6365

6466
## DESCRIPTION
@@ -75,7 +77,12 @@ This example creates an instance of a CIM Class named win32_environment in the r
7577
on the computer.
7678

7779
```powershell
78-
New-CimInstance -ClassName Win32_Environment -Property @{Name="testvar";VariableValue="testvalue";UserName="domain\user"}
80+
$prop = @{
81+
Name = "testvar"
82+
VariableValue = "testvalue"
83+
UserName = "domain\user"
84+
}
85+
New-CimInstance -ClassName Win32_Environment -Property $prop
7986
```
8087

8188
No client side validation is performed if the class does not exist, the properties are wrong, or if
@@ -89,7 +96,12 @@ of the variable are then passed to the `New-CimInstance` cmdlet.
8996

9097
```powershell
9198
$class = Get-CimClass -ClassName Win32_Environment
92-
New-CimInstance -CimClass $class -Property @{Name="testvar";VariableValue="testvalue";UserName="Contoso\User1"}
99+
$prop = @{
100+
Name = "testvar"
101+
VariableValue = "testvalue"
102+
UserName = "Contoso\User1"
103+
}
104+
New-CimInstance -CimClass $class -Property $prop
93105
```
94106

95107
### Example 3: Create a dynamic instance on the client
@@ -100,7 +112,16 @@ computer without getting the instance from the server. The new instance is store
100112
on the server.
101113

102114
```powershell
103-
$a = New-CimInstance -ClassName Win32_Process -Property @{Handle=0} -Key Handle -ClientOnly
115+
$instance = @{
116+
ClassName = 'Win32_Process'
117+
Property = @{
118+
Handle = 0
119+
}
120+
Key = 'Handle'
121+
ClientOnly = $true
122+
}
123+
$a = New-CimInstance @instance
124+
104125
Get-CimInstance -CimInstance $a
105126
Invoke-CimMethod -CimInstance $a -MethodName GetOwner
106127
```
@@ -385,7 +406,7 @@ Accept wildcard characters: False
385406
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
386407
-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose,
387408
-WarningAction, and -WarningVariable. For more information, see
388-
[about_CommonParameters](../Microsoft.PowerShell.Core/About/about_CommonParameters.md).
409+
[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).
389410

390411
## INPUTS
391412

reference/5.1/CimCmdlets/New-CimSession.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,17 @@ Creates a CIM session.
1717
### CredentialParameterSet (Default)
1818

1919
```
20-
New-CimSession [-Authentication <PasswordAuthenticationMechanism>] [[-Credential] <PSCredential>]
21-
[[-ComputerName] <String[]>] [-Name <String>] [-OperationTimeoutSec <UInt32>] [-SkipTestConnection]
22-
[-Port <UInt32>] [-SessionOption <CimSessionOptions>] [<CommonParameters>]
20+
New-CimSession [-Authentication <PasswordAuthenticationMechanism>]
21+
[[-Credential] <PSCredential>] [[-ComputerName] <String[]>] [-Name <String>]
22+
[-OperationTimeoutSec <UInt32>] [-SkipTestConnection] [-Port <UInt32>]
23+
[-SessionOption <CimSessionOptions>] [<CommonParameters>]
2324
```
2425

2526
### CertificateParameterSet
2627

2728
```
28-
New-CimSession [-CertificateThumbprint <String>] [[-ComputerName] <String[]>] [-Name <String>]
29-
[-OperationTimeoutSec <UInt32>] [-SkipTestConnection] [-Port <UInt32>]
29+
New-CimSession [-CertificateThumbprint <String>] [[-ComputerName] <String[]>]
30+
[-Name <String>] [-OperationTimeoutSec <UInt32>] [-SkipTestConnection] [-Port <UInt32>]
3031
[-SessionOption <CimSessionOptions>] [<CommonParameters>]
3132
```
3233

@@ -65,7 +66,7 @@ This example creates a CIM session to each of the computers specified by **Compu
6566
comma separated list.
6667

6768
```powershell
68-
New-CimSession -ComputerName Server01,Server02,Server03
69+
New-CimSession -ComputerName Server01, Server02, Server03
6970
```
7071

7172
### Example 4: Create a CIM session with a friendly name
@@ -74,7 +75,7 @@ This example creates a remote CIM session to each of the computers specified by
7475
the comma separated list, and assigns a friendly name to the new sessions, by specifying **Name**.
7576

7677
```powershell
77-
New-CimSession -ComputerName Server01,Server02 -Name FileServers
78+
New-CimSession -ComputerName Server01, Server02 -Name FileServers
7879
Get-CimSession -Name File*
7980
```
8081

@@ -237,8 +238,8 @@ Accept wildcard characters: False
237238
Specifies a friendly name for the CIM session.
238239

239240
You can use the name to refer to the CIM session when using other cmdlets, such as the
240-
[`Get-CimSession`](Get-CimSession.md) cmdlet.
241-
The name is not required to be unique to the computer or the current session.
241+
[Get-CimSession](Get-CimSession.md) cmdlet. The name is not required to be unique to the computer
242+
or the current session.
242243

243244
```yaml
244245
Type: System.String
@@ -348,7 +349,7 @@ Accept wildcard characters: False
348349
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
349350
-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose,
350351
-WarningAction, and -WarningVariable. For more information, see
351-
[about_CommonParameters](../Microsoft.PowerShell.Core/About/about_CommonParameters.md).
352+
[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).
352353

353354
## INPUTS
354355

reference/5.1/CimCmdlets/New-CimSessionOption.md

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ Specifies advanced options for the New-CimSession cmdlet.
1818
### ProtocolTypeSet (Default)
1919

2020
```
21-
New-CimSessionOption [-Protocol] <ProtocolType> [-UICulture <CultureInfo>] [-Culture <CultureInfo>]
22-
[<CommonParameters>]
21+
New-CimSessionOption [-Protocol] <ProtocolType> [-UICulture <CultureInfo>]
22+
[-Culture <CultureInfo>] [<CommonParameters>]
2323
```
2424

2525
### WSManParameterSet
@@ -28,15 +28,16 @@ New-CimSessionOption [-Protocol] <ProtocolType> [-UICulture <CultureInfo>] [-Cul
2828
New-CimSessionOption [-NoEncryption] [-SkipCACheck] [-SkipCNCheck] [-SkipRevocationCheck]
2929
[-EncodePortInServicePrincipalName] [-Encoding <PacketEncoding>] [-HttpPrefix <Uri>]
3030
[-MaxEnvelopeSizeKB <UInt32>] [-ProxyAuthentication <PasswordAuthenticationMechanism>]
31-
[-ProxyCertificateThumbprint <String>] [-ProxyCredential <PSCredential>] [-ProxyType <ProxyType>]
32-
[-UseSsl] [-UICulture <CultureInfo>] [-Culture <CultureInfo>] [<CommonParameters>]
31+
[-ProxyCertificateThumbprint <String>] [-ProxyCredential <PSCredential>]
32+
[-ProxyType <ProxyType>] [-UseSsl] [-UICulture <CultureInfo>] [-Culture <CultureInfo>]
33+
[<CommonParameters>]
3334
```
3435

3536
### DcomParameterSet
3637

3738
```
38-
New-CimSessionOption [-Impersonation <ImpersonationType>] [-PacketIntegrity] [-PacketPrivacy]
39-
[-UICulture <CultureInfo>] [-Culture <CultureInfo>] [<CommonParameters>]
39+
New-CimSessionOption [-Impersonation <ImpersonationType>] [-PacketIntegrity]
40+
[-PacketPrivacy] [-UICulture <CultureInfo>] [-Culture <CultureInfo>] [<CommonParameters>]
4041
```
4142

4243
## DESCRIPTION
@@ -71,7 +72,14 @@ parameter, the credentials specified by the **ProxyCredential** parameter, and s
7172
command is to skip the CA check, skip the CN check, and use SSL.
7273

7374
```powershell
74-
New-CimSessionOption -ProxyAuthentication Kerberos -ProxyCredential $cred -SkipCACheck -SkipCNCheck -UseSsl
75+
$option = @{
76+
ProxyAuthentication = 'Kerberos'
77+
ProxyCredential = $cred
78+
SkipCACheck = $true
79+
SkipCNCheck = $true
80+
UseSsl = $true
81+
}
82+
New-CimSessionOption @option
7583
```
7684

7785
### Example 3: Create a CIM session options object with the culture specified

reference/5.1/CimCmdlets/Register-CimIndicationEvent.md

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -36,19 +36,19 @@ Register-CimIndicationEvent [-Namespace <String>] [-ClassName] <String>
3636
### QueryExpressionSessionSet
3737

3838
```
39-
Register-CimIndicationEvent [-Namespace <String>] [-Query] <String> [-QueryDialect <String>]
40-
[-OperationTimeoutSec <UInt32>] -CimSession <CimSession> [[-SourceIdentifier] <String>]
41-
[[-Action] <ScriptBlock>] [-MessageData <PSObject>] [-SupportEvent] [-Forward]
42-
[-MaxTriggerCount <Int32>] [<CommonParameters>]
39+
Register-CimIndicationEvent [-Namespace <String>] [-Query] <String>
40+
[-QueryDialect <String>] [-OperationTimeoutSec <UInt32>] -CimSession <CimSession>
41+
[[-SourceIdentifier] <String>] [[-Action] <ScriptBlock>] [-MessageData <PSObject>]
42+
[-SupportEvent] [-Forward] [-MaxTriggerCount <Int32>] [<CommonParameters>]
4343
```
4444

4545
### QueryExpressionComputerSet
4646

4747
```
48-
Register-CimIndicationEvent [-Namespace <String>] [-Query] <String> [-QueryDialect <String>]
49-
[-OperationTimeoutSec <UInt32>] [-ComputerName <String>] [[-SourceIdentifier] <String>]
50-
[[-Action] <ScriptBlock>] [-MessageData <PSObject>] [-SupportEvent] [-Forward]
51-
[-MaxTriggerCount <Int32>] [<CommonParameters>]
48+
Register-CimIndicationEvent [-Namespace <String>] [-Query] <String>
49+
[-QueryDialect <String>] [-OperationTimeoutSec <UInt32>] [-ComputerName <String>]
50+
[[-SourceIdentifier] <String>] [[-Action] <ScriptBlock>] [-MessageData <PSObject>]
51+
[-SupportEvent] [-Forward] [-MaxTriggerCount <Int32>] [<CommonParameters>]
5252
```
5353

5454
## DESCRIPTION
@@ -67,7 +67,11 @@ This example subscribes to the events generated by the class named **Win32_Proce
6767
class raises an event whenever a process starts.
6868

6969
```powershell
70-
Register-CimIndicationEvent -ClassName 'Win32_ProcessStartTrace' -SourceIdentifier "ProcessStarted"
70+
$event = @{
71+
ClassName = 'Win32_ProcessStartTrace'
72+
SourceIdentifier = 'ProcessStarted'
73+
}
74+
Register-CimIndicationEvent @event
7175
Get-Event -SourceIdentifier "ProcessStarted"
7276
```
7377

@@ -98,7 +102,12 @@ $action = {
98102
$id = $event.SourceEventArgs.NewEvent.ProcessId
99103
Write-Host -Object "New Process Started : Name = $name ID = $id"
100104
}
101-
Register-CimIndicationEvent -ClassName 'Win32_ProcessStartTrace' -SourceIdentifier "ProcessStarted" -Action $action
105+
$event = @{
106+
ClassName = 'Win32_ProcessStartTrace'
107+
SourceIdentifier = 'ProcessStarted'
108+
Action = $action
109+
}
110+
Register-CimIndicationEvent @event
102111
```
103112

104113
For more information, see
@@ -111,7 +120,12 @@ CIM server are stored in the event queue in the current PowerShell session and t
111120
`Get-Event` to retrieve the events.
112121

113122
```powershell
114-
Register-CimIndicationEvent -ClassName 'Win32_ProcessStartTrace' -SourceIdentifier "ProcessStarted" -ComputerName Server01
123+
$event = @{
124+
ClassName = 'Win32_ProcessStartTrace'
125+
SourceIdentifier = 'ProcessStarted'
126+
ComputerName = 'Server01'
127+
}
128+
Register-CimIndicationEvent @event
115129
Get-Event -SourceIdentifier "ProcessStarted"
116130
```
117131

@@ -126,7 +140,7 @@ event is raised, instead of sending the event to the event queue. Enclose the co
126140
The script block specified with **Action** can include the `$Event`, `$EventSubscriber`, `$Sender`,
127141
`$SourceEventArgs`, and `$SourceArgs` automatic variables, which provide information about the event
128142
to the **Action** script block. For more information, see
129-
[About Automatic Variables](../microsoft.powershell.core/about/about_automatic_variables.md).
143+
[About Automatic Variables](../Microsoft.PowerShell.Core/About/about_Automatic_Variables.md).
130144

131145
```yaml
132146
Type: System.Management.Automation.ScriptBlock
@@ -401,4 +415,3 @@ This cmdlet returns an **EventSubscription** object.
401415
[Get-CimSession](Get-CimSession.md)
402416

403417
[New-CimSession](New-CimSession.md)
404-

reference/5.1/CimCmdlets/Remove-CimInstance.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,31 +17,33 @@ Removes a CIM instance from a computer.
1717
### CimInstanceComputerSet (Default)
1818

1919
```
20-
Remove-CimInstance [-ResourceUri <Uri>] [-ComputerName <String[]>] [-OperationTimeoutSec <UInt32>]
21-
[-InputObject] <CimInstance> [-WhatIf] [-Confirm] [<CommonParameters>]
20+
Remove-CimInstance [-ResourceUri <Uri>] [-ComputerName <String[]>]
21+
[-OperationTimeoutSec <UInt32>] [-InputObject] <CimInstance> [-WhatIf] [-Confirm]
22+
[<CommonParameters>]
2223
```
2324

2425
### CimInstanceSessionSet
2526

2627
```
27-
Remove-CimInstance -CimSession <CimSession[]> [-ResourceUri <Uri>] [-OperationTimeoutSec <UInt32>]
28-
[-InputObject] <CimInstance> [-WhatIf] [-Confirm] [<CommonParameters>]
28+
Remove-CimInstance -CimSession <CimSession[]> [-ResourceUri <Uri>]
29+
[-OperationTimeoutSec <UInt32>] [-InputObject] <CimInstance> [-WhatIf] [-Confirm]
30+
[<CommonParameters>]
2931
```
3032

3133
### QuerySessionSet
3234

3335
```
3436
Remove-CimInstance -CimSession <CimSession[]> [[-Namespace] <String>]
35-
[-OperationTimeoutSec <UInt32>] [-Query] <String> [-QueryDialect <String>] [-WhatIf] [-Confirm]
36-
[<CommonParameters>]
37+
[-OperationTimeoutSec <UInt32>] [-Query] <String> [-QueryDialect <String>] [-WhatIf]
38+
[-Confirm] [<CommonParameters>]
3739
```
3840

3941
### QueryComputerSet
4042

4143
```
4244
Remove-CimInstance [-ComputerName <String[]>] [[-Namespace] <String>]
43-
[-OperationTimeoutSec <UInt32>] [-Query] <String> [-QueryDialect <String>] [-WhatIf] [-Confirm]
44-
[<CommonParameters>]
45+
[-OperationTimeoutSec <UInt32>] [-Query] <String> [-QueryDialect <String>] [-WhatIf]
46+
[-Confirm] [<CommonParameters>]
4547
```
4648

4749
## DESCRIPTION

0 commit comments

Comments
 (0)