Skip to content

Commit 020827f

Browse files
authored
Merge pull request #11664 from MicrosoftDocs/main
1/13/2025 PM Publish
2 parents 5d91adf + 8dba7f0 commit 020827f

File tree

6 files changed

+50
-35
lines changed

6 files changed

+50
-35
lines changed

reference/5.1/Microsoft.PowerShell.Core/About/about_Comments.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,14 +127,14 @@ function Get-Function { }
127127

128128
For more information, see:
129129

130-
- [about_Comment_Based_Help][05].
130+
- [about_Comment_Based_Help][05]
131131
- [Writing Comment-Based Help Topics][03]
132132

133133
### `#Requires`
134134

135135
The `#Requires` statement prevents a script from running unless the current
136-
PowerShell sessions meets the specified prerequisites. `#Requires` can appear
137-
on any line in a script, but is processed in the same manner regardless of
136+
PowerShell session meets the specified prerequisites. `#Requires` can appear on
137+
any line in a script, but is processed in the same manner regardless of
138138
position.
139139

140140
```powershell
@@ -171,7 +171,7 @@ sections of code. For PowerShell, the region markers are comments that begin
171171
with `#region` and end with `#endregion`. The region markers must be at the
172172
beginning of a line. The region markers are supported in the PowerShell ISE and
173173
in Visual Studio Code with the PowerShell extension. The region markers aren't
174-
a part of the PowerShell language. PowerShell interprets them as a regular
174+
a part of the PowerShell language. PowerShell interprets them as regular
175175
comments.
176176

177177
For more information, see the _Folding_ section of the

reference/5.1/Microsoft.PowerShell.Utility/Register-EngineEvent.md

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml
33
Locale: en-US
44
Module Name: Microsoft.PowerShell.Utility
5-
ms.date: 12/12/2022
5+
ms.date: 01/13/2025
66
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/register-engineevent?view=powershell-5.1&WT.mc_id=ps-gethelp
77
schema: 2.0.0
88
title: Register-EngineEvent
@@ -16,8 +16,9 @@ Subscribes to events that are generated by the PowerShell engine and by the `New
1616
## SYNTAX
1717

1818
```
19-
Register-EngineEvent [-SourceIdentifier] <String> [[-Action] <ScriptBlock>] [-MessageData <PSObject>]
20-
[-SupportEvent] [-Forward] [-MaxTriggerCount <Int32>] [<CommonParameters>]
19+
Register-EngineEvent [-SourceIdentifier] <String> [[-Action] <ScriptBlock>]
20+
[-MessageData <PSObject>] [-SupportEvent] [-Forward] [-MaxTriggerCount <Int32>]
21+
[<CommonParameters>]
2122
```
2223

2324
## DESCRIPTION
@@ -80,15 +81,19 @@ data to a text file.
8081

8182
```powershell
8283
Register-EngineEvent -SourceIdentifier MyEventSource -Action {
83-
"Event: {0}" -f $event.messagedata | Out-File c:\temp\MyEvents.txt -Append
84+
"Event: {0}" -f $event.MessageData | Out-File c:\temp\MyEvents.txt -Append
8485
}
8586
8687
Start-Job -Name TestJob -ScriptBlock {
8788
While ($True) {
8889
Register-EngineEvent -SourceIdentifier MyEventSource -Forward
8990
Start-Sleep -seconds 2
9091
"Doing some work..."
91-
New-Event -SourceIdentifier MyEventSource -Message ("{0} - Work done..." -f (Get-Date))
92+
$newEventSplat = @{
93+
SourceIdentifier = 'MyEventSource'
94+
MessageData = ("{0} - Work done..." -f (Get-Date))
95+
}
96+
New-Event @newEventSplat
9297
}
9398
}
9499
Start-Sleep -seconds 4
@@ -209,8 +214,8 @@ Accept wildcard characters: False
209214
210215
### -MessageData
211216
212-
Specifies additional data associated with the event. The value of this parameter appears in the
213-
**MessageData** property of the event object.
217+
This parameter is part of the base class for all Event cmdlets. The `Register-EngineEvent` doesn't
218+
use this parameter. Any data passed to this parameter is ignored.
214219

215220
```yaml
216221
Type: System.Management.Automation.PSObject

reference/7.4/Microsoft.PowerShell.Core/About/about_Comments.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -127,14 +127,14 @@ function Get-Function { }
127127

128128
For more information, see:
129129

130-
- [about_Comment_Based_Help][05].
130+
- [about_Comment_Based_Help][05]
131131
- [Writing Comment-Based Help Topics][03]
132132

133133
### `#Requires`
134134

135135
The `#Requires` statement prevents a script from running unless the current
136-
PowerShell sessions meets the specified prerequisites. `#Requires` can appear
137-
on any line in a script, but is processed in the same manner regardless of
136+
PowerShell session meets the specified prerequisites. `#Requires` can appear on
137+
any line in a script, but is processed in the same manner regardless of
138138
position.
139139

140140
```powershell
@@ -171,7 +171,7 @@ beginning of a script to indicate which shell should be used to run the script.
171171
Shebang isn't a part of the PowerShell language. PowerShell interprets it as a
172172
regular comment. Shebang is interpreted by the operating system.
173173

174-
In the following example, the shebang ensures PowerShell run the script when
174+
In the following example, the shebang ensures PowerShell runs the script when
175175
the script is invoked from a non-PowerShell context.
176176

177177
```powershell
@@ -186,7 +186,7 @@ sections of code. For PowerShell, the region markers are comments that begin
186186
with `#region` and end with `#endregion`. The region markers must be at the
187187
beginning of a line. The region markers are supported in the PowerShell ISE and
188188
in Visual Studio Code with the PowerShell extension. The region markers aren't
189-
a part of the PowerShell language. PowerShell interprets them as a regular
189+
a part of the PowerShell language. PowerShell interprets them as regular
190190
comments.
191191

192192
For more information, see the _Folding_ section of the

reference/7.4/Microsoft.PowerShell.Utility/Register-EngineEvent.md

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml
33
Locale: en-US
44
Module Name: Microsoft.PowerShell.Utility
5-
ms.date: 12/12/2022
5+
ms.date: 01/13/2025
66
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/register-engineevent?view=powershell-7.4&WT.mc_id=ps-gethelp
77
schema: 2.0.0
88
title: Register-EngineEvent
@@ -16,8 +16,9 @@ Subscribes to events that are generated by the PowerShell engine and by the `New
1616
## SYNTAX
1717

1818
```
19-
Register-EngineEvent [-SourceIdentifier] <String> [[-Action] <ScriptBlock>] [-MessageData <PSObject>]
20-
[-SupportEvent] [-Forward] [-MaxTriggerCount <Int32>] [<CommonParameters>]
19+
Register-EngineEvent [-SourceIdentifier] <String> [[-Action] <ScriptBlock>]
20+
[-MessageData <PSObject>] [-SupportEvent] [-Forward] [-MaxTriggerCount <Int32>]
21+
[<CommonParameters>]
2122
```
2223

2324
## DESCRIPTION
@@ -80,15 +81,19 @@ data to a text file.
8081

8182
```powershell
8283
Register-EngineEvent -SourceIdentifier MyEventSource -Action {
83-
"Event: {0}" -f $event.messagedata | Out-File c:\temp\MyEvents.txt -Append
84+
"Event: {0}" -f $event.MessageData | Out-File c:\temp\MyEvents.txt -Append
8485
}
8586
8687
Start-Job -Name TestJob -ScriptBlock {
8788
While ($True) {
8889
Register-EngineEvent -SourceIdentifier MyEventSource -Forward
8990
Start-Sleep -seconds 2
9091
"Doing some work..."
91-
New-Event -SourceIdentifier MyEventSource -Message ("{0} - Work done..." -f (Get-Date))
92+
$newEventSplat = @{
93+
SourceIdentifier = 'MyEventSource'
94+
MessageData = ("{0} - Work done..." -f (Get-Date))
95+
}
96+
New-Event @newEventSplat
9297
}
9398
}
9499
Start-Sleep -seconds 4
@@ -209,8 +214,8 @@ Accept wildcard characters: False
209214
210215
### -MessageData
211216
212-
Specifies additional data associated with the event. The value of this parameter appears in the
213-
**MessageData** property of the event object.
217+
This parameter is part of the base class for all Event cmdlets. The `Register-EngineEvent` doesn't
218+
use this parameter. Any data passed to this parameter is ignored.
214219

215220
```yaml
216221
Type: System.Management.Automation.PSObject

reference/7.5/Microsoft.PowerShell.Core/About/about_Comments.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -127,14 +127,14 @@ function Get-Function { }
127127

128128
For more information, see:
129129

130-
- [about_Comment_Based_Help][05].
130+
- [about_Comment_Based_Help][05]
131131
- [Writing Comment-Based Help Topics][03]
132132

133133
### `#Requires`
134134

135135
The `#Requires` statement prevents a script from running unless the current
136-
PowerShell sessions meets the specified prerequisites. `#Requires` can appear
137-
on any line in a script, but is processed in the same manner regardless of
136+
PowerShell session meets the specified prerequisites. `#Requires` can appear on
137+
any line in a script, but is processed in the same manner regardless of
138138
position.
139139

140140
```powershell
@@ -171,7 +171,7 @@ beginning of a script to indicate which shell should be used to run the script.
171171
Shebang isn't a part of the PowerShell language. PowerShell interprets it as a
172172
regular comment. Shebang is interpreted by the operating system.
173173

174-
In the following example, the shebang ensures PowerShell run the script when
174+
In the following example, the shebang ensures PowerShell runs the script when
175175
the script is invoked from a non-PowerShell context.
176176

177177
```powershell
@@ -186,7 +186,7 @@ sections of code. For PowerShell, the region markers are comments that begin
186186
with `#region` and end with `#endregion`. The region markers must be at the
187187
beginning of a line. The region markers are supported in the PowerShell ISE and
188188
in Visual Studio Code with the PowerShell extension. The region markers aren't
189-
a part of the PowerShell language. PowerShell interprets them as a regular
189+
a part of the PowerShell language. PowerShell interprets them as regular
190190
comments.
191191

192192
For more information, see the _Folding_ section of the

reference/7.5/Microsoft.PowerShell.Utility/Register-EngineEvent.md

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml
33
Locale: en-US
44
Module Name: Microsoft.PowerShell.Utility
5-
ms.date: 12/12/2022
5+
ms.date: 01/13/2025
66
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/register-engineevent?view=powershell-7.5&WT.mc_id=ps-gethelp
77
schema: 2.0.0
88
title: Register-EngineEvent
@@ -16,8 +16,9 @@ Subscribes to events that are generated by the PowerShell engine and by the `New
1616
## SYNTAX
1717

1818
```
19-
Register-EngineEvent [-SourceIdentifier] <String> [[-Action] <ScriptBlock>] [-MessageData <PSObject>]
20-
[-SupportEvent] [-Forward] [-MaxTriggerCount <Int32>] [<CommonParameters>]
19+
Register-EngineEvent [-SourceIdentifier] <String> [[-Action] <ScriptBlock>]
20+
[-MessageData <PSObject>] [-SupportEvent] [-Forward] [-MaxTriggerCount <Int32>]
21+
[<CommonParameters>]
2122
```
2223

2324
## DESCRIPTION
@@ -80,15 +81,19 @@ data to a text file.
8081

8182
```powershell
8283
Register-EngineEvent -SourceIdentifier MyEventSource -Action {
83-
"Event: {0}" -f $event.messagedata | Out-File c:\temp\MyEvents.txt -Append
84+
"Event: {0}" -f $event.MessageData | Out-File c:\temp\MyEvents.txt -Append
8485
}
8586
8687
Start-Job -Name TestJob -ScriptBlock {
8788
While ($True) {
8889
Register-EngineEvent -SourceIdentifier MyEventSource -Forward
8990
Start-Sleep -seconds 2
9091
"Doing some work..."
91-
New-Event -SourceIdentifier MyEventSource -Message ("{0} - Work done..." -f (Get-Date))
92+
$newEventSplat = @{
93+
SourceIdentifier = 'MyEventSource'
94+
MessageData = ("{0} - Work done..." -f (Get-Date))
95+
}
96+
New-Event @newEventSplat
9297
}
9398
}
9499
Start-Sleep -seconds 4
@@ -209,8 +214,8 @@ Accept wildcard characters: False
209214
210215
### -MessageData
211216
212-
Specifies additional data associated with the event. The value of this parameter appears in the
213-
**MessageData** property of the event object.
217+
This parameter is part of the base class for all Event cmdlets. The `Register-EngineEvent` doesn't
218+
use this parameter. Any data passed to this parameter is ignored.
214219

215220
```yaml
216221
Type: System.Management.Automation.PSObject

0 commit comments

Comments
 (0)