Skip to content

Commit faebf22

Browse files
committed
Markdown and PS Styles
1 parent 766480e commit faebf22

12 files changed

+305
-150
lines changed

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

reference/5.1/CimCmdlets/Set-CimInstance.md

Lines changed: 41 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -17,33 +17,33 @@ Modifies a CIM instance on a CIM server by calling the ModifyInstance method of
1717
### CimInstanceComputerSet (Default)
1818

1919
```
20-
Set-CimInstance [-ComputerName <String[]>] [-ResourceUri <Uri>] [-OperationTimeoutSec <UInt32>]
21-
[-InputObject] <CimInstance> [-Property <IDictionary>] [-PassThru] [-WhatIf] [-Confirm]
22-
[<CommonParameters>]
20+
Set-CimInstance [-ComputerName <String[]>] [-ResourceUri <Uri>]
21+
[-OperationTimeoutSec <UInt32>] [-InputObject] <CimInstance> [-Property <IDictionary>]
22+
[-PassThru] [-WhatIf] [-Confirm] [<CommonParameters>]
2323
```
2424

2525
### CimInstanceSessionSet
2626

2727
```
28-
Set-CimInstance -CimSession <CimSession[]> [-ResourceUri <Uri>] [-OperationTimeoutSec <UInt32>]
29-
[-InputObject] <CimInstance> [-Property <IDictionary>] [-PassThru] [-WhatIf] [-Confirm]
30-
[<CommonParameters>]
28+
Set-CimInstance -CimSession <CimSession[]> [-ResourceUri <Uri>]
29+
[-OperationTimeoutSec <UInt32>] [-InputObject] <CimInstance> [-Property <IDictionary>]
30+
[-PassThru] [-WhatIf] [-Confirm] [<CommonParameters>]
3131
```
3232

3333
### QuerySessionSet
3434

3535
```
36-
Set-CimInstance -CimSession <CimSession[]> [-Namespace <String>] [-OperationTimeoutSec <UInt32>]
37-
[-Query] <String> [-QueryDialect <String>] -Property <IDictionary> [-PassThru] [-WhatIf] [-Confirm]
38-
[<CommonParameters>]
36+
Set-CimInstance -CimSession <CimSession[]> [-Namespace <String>]
37+
[-OperationTimeoutSec <UInt32>] [-Query] <String> [-QueryDialect <String>]
38+
-Property <IDictionary> [-PassThru] [-WhatIf] [-Confirm] [<CommonParameters>]
3939
```
4040

4141
### QueryComputerSet
4242

4343
```
44-
Set-CimInstance [-ComputerName <String[]>] [-Namespace <String>] [-OperationTimeoutSec <UInt32>]
45-
[-Query] <String> [-QueryDialect <String>] -Property <IDictionary> [-PassThru] [-WhatIf] [-Confirm]
46-
[<CommonParameters>]
44+
Set-CimInstance [-ComputerName <String[]>] [-Namespace <String>]
45+
[-OperationTimeoutSec <UInt32>] [-Query] <String> [-QueryDialect <String>]
46+
-Property <IDictionary> [-PassThru] [-WhatIf] [-Confirm] [<CommonParameters>]
4747
```
4848

4949
## DESCRIPTION
@@ -76,7 +76,11 @@ parameter. You can modify instances matching a Windows Management Instrumentatio
7676
(WQL) query.
7777

7878
```powershell
79-
Set-CimInstance -Query 'Select * from Win32_Environment where name LIKE "testvar%"' -Property @{VariableValue="abcd"}
79+
$instance = @ {
80+
Query = 'Select * from Win32_Environment where name LIKE "testvar%"'
81+
Property = @{VariableValue="abcd"}
82+
}
83+
Set-CimInstance @instance
8084
```
8185

8286
### Example 2: Set the CIM instance property using pipeline
@@ -121,7 +125,12 @@ This example uses the common parameter **WhatIf** to specify that the modificati
121125
done, but only output what would happen if it were done.
122126

123127
```powershell
124-
Set-CimInstance -Query 'Select * from Win32_Environment where name LIKE "testvar%"' -Property @{VariableValue="abcd"} -WhatIf
128+
$instance = @{
129+
Query = 'Select * from Win32_Environment where name LIKE "testvar%"'
130+
Property = @{VariableValue="abcd"}
131+
WhatIf = $true
132+
}
133+
Set-CimInstance @instance
125134
```
126135

127136
### Example 6: Set the CIM instance after confirmation from the user
@@ -130,7 +139,12 @@ This example uses the common parameter **Confirm** to specify that the modificat
130139
only after confirmation from the user.
131140

132141
```powershell
133-
Set-CimInstance -Query 'Select * from Win32_Environment where name LIKE "testvar%"' -Property @{VariableValue="abcd"} -Confirm
142+
$instance = @{
143+
Query = 'Select * from Win32_Environment where name LIKE "testvar%"'
144+
Property = @{VariableValue="abcd"}
145+
Confirm = $true
146+
}
147+
Set-CimInstance @instance
134148
```
135149

136150
### Example 7: Set the created CIM instance
@@ -141,7 +155,16 @@ cmdlet, and retrieves its contents in to a variable `$x`. The variable is then p
141155
Because the **PassThru** parameter is used, This example returns a modified CIM instance object.
142156

143157
```powershell
144-
$x = New-CimInstance -ClassName Win32_Environment -Property @{Name="testvar";UserName="domain\user"} -Key Name, UserName -ClientOnly
158+
$instance = @{
159+
ClassName = 'Win32_Environment'
160+
Property = @{
161+
Name="testvar"
162+
UserName="domain\user"
163+
}
164+
Key = 'Name', 'UserName'
165+
ClientOnly = $true
166+
}
167+
$x = New-CimInstance @instance
145168
Set-CimInstance -CimInstance $x -Property @{VariableValue="somevalue"} -PassThru
146169
```
147170

@@ -154,7 +177,7 @@ of a `New-CimSession` or `Get-CimSession` cmdlet.
154177

155178
```yaml
156179
Type: Microsoft.Management.Infrastructure.CimSession[]
157-
Parameter Sets: QuerySessionSet, CimInstanceSessionSet
180+
Parameter Sets: CimInstanceSessionSet, QuerySessionSet
158181
Aliases:
159182

160183
Required: True
@@ -395,7 +418,7 @@ Accept wildcard characters: False
395418
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
396419
-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose,
397420
-WarningAction, and -WarningVariable. For more information, see
398-
[about_CommonParameters](../Microsoft.PowerShell.Core/About/about_CommonParameters.md).
421+
[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).
399422
400423
## INPUTS
401424

reference/7.4/CimCmdlets/Register-CimIndicationEvent.md

Lines changed: 26 additions & 12 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
@@ -69,7 +69,11 @@ This example subscribes to the events generated by the class named **Win32_Proce
6969
class raises an event whenever a process starts.
7070

7171
```powershell
72-
Register-CimIndicationEvent -ClassName 'Win32_ProcessStartTrace' -SourceIdentifier "ProcessStarted"
72+
$event = @{
73+
ClassName = 'Win32_ProcessStartTrace'
74+
SourceIdentifier = 'ProcessStarted'
75+
}
76+
Register-CimIndicationEvent @event
7377
Get-Event -SourceIdentifier "ProcessStarted"
7478
```
7579

@@ -100,7 +104,12 @@ $action = {
100104
$id = $event.SourceEventArgs.NewEvent.ProcessId
101105
Write-Host -Object "New Process Started : Name = $name ID = $id"
102106
}
103-
Register-CimIndicationEvent -ClassName 'Win32_ProcessStartTrace' -SourceIdentifier "ProcessStarted" -Action $action
107+
$event = @{
108+
ClassName = 'Win32_ProcessStartTrace'
109+
SourceIdentifier = 'ProcessStarted'
110+
Action = $action
111+
}
112+
Register-CimIndicationEvent @event
104113
```
105114

106115
For more information, see
@@ -113,7 +122,12 @@ CIM server are stored in the event queue in the current PowerShell session and t
113122
`Get-Event` to retrieve the events.
114123

115124
```powershell
116-
Register-CimIndicationEvent -ClassName 'Win32_ProcessStartTrace' -SourceIdentifier "ProcessStarted" -ComputerName Server01
125+
$event = @{
126+
ClassName = 'Win32_ProcessStartTrace'
127+
SourceIdentifier = 'ProcessStarted'
128+
ComputerName = 'Server01'
129+
}
130+
Register-CimIndicationEvent @event
117131
Get-Event -SourceIdentifier "ProcessStarted"
118132
```
119133

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

133147
```yaml
134148
Type: System.Management.Automation.ScriptBlock

reference/7.4/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)