Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
properties to the fully qualified ID, the type of the error, the error message, and the target
object (which for GH CLI errors is always the command-line arguments for the failing command).
It can retrieve errors from the `$error` variable or act on an input object.
It can retrieve errors from the `$Error` variable or act on an input object.
.PARAMETER Newest
Specifies the number of error records to return, from newest to oldest.
.PARAMETER InputObject
Expand All @@ -19,7 +19,7 @@
The cmdlet gets the alternate view for the last error in the session.
.EXAMPLE
```powershell
Get-GHAConsoleError -InputObject $error[0]
Get-GHAConsoleError -InputObject $Error[0]
```
The cmdlet gets the alternate view for the last error in the session.
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/.pwsh/module/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ This cmdlet returns an alternate view of an error record for the GH CLI. It limi
properties to the fully qualified ID, the type of the error, the error message, and the target
object (which for GH CLI errors is always the command-line arguments for the failing command).

It can retrieve errors from the `$error` variable or act on an input object.
It can retrieve errors from the `$Error` variable or act on an input object.

For more information, review the [source code][utility-Get-GHAConsoleError]

Expand Down
6 changes: 3 additions & 3 deletions reference/5.1/CimCmdlets/Register-CimIndicationEvent.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,12 @@ Register-CimIndicationEvent -Query $query -SourceIdentifier "Timer"
### Example 3: Run a script when the event arrives

This example shows how to use an action in response to an event. The variable `$action` holds the
script block for **Action**, which uses the `$event` variable to access the event received from CIM.
script block for **Action**, which uses the `$Event` variable to access the event received from CIM.

```powershell
$action = {
$name = $event.SourceEventArgs.NewEvent.ProcessName
$id = $event.SourceEventArgs.NewEvent.ProcessId
$name = $Event.SourceEventArgs.NewEvent.ProcessName
$id = $Event.SourceEventArgs.NewEvent.ProcessId
Write-Host -Object "New Process Started : Name = $name ID = $id"
}
$event = @{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ You can use this parameter to create a variable that contains only error
messages from specific commands and doesn't affect the behavior of the `$Error`
automatic variable. The `$Error` automatic variable contains error messages
from all the commands in the session. You can use array notation, such as
`$a[0]` or `$error[1,2]` to refer to specific errors stored in the variables.
`$a[0]` or `$Error[1,2]` to refer to specific errors stored in the variables.

> [!NOTE]
> The custom error variable contains all errors generated by the command,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ For example:
```

```Output
"PS $($executionContext.SessionState.Path.CurrentLocation)$('>' * ($nestedPromptLevel + 1)) "
"PS $($ExecutionContext.SessionState.Path.CurrentLocation)$('>' * ($nestedPromptLevel + 1)) "
# .Link
# https://go.microsoft.com/fwlink/?LinkID=225750
# .ExternalHelp System.Management.Automation.dll-help.xml
Expand Down Expand Up @@ -114,7 +114,7 @@ PowerShell includes a built-in `Prompt` function.

```powershell
function prompt {
"PS $($executionContext.SessionState.Path.CurrentLocation)$('>' * ($nestedPromptLevel + 1)) ";
"PS $($ExecutionContext.SessionState.Path.CurrentLocation)$('>' * ($nestedPromptLevel + 1)) ";
# .Link
# https://go.microsoft.com/fwlink/?LinkID=225750
# .ExternalHelp System.Management.Automation.dll-help.xml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ The following example shows a `Test-Remote.ps1` script that has a
param ($ComputerName = $(throw "ComputerName parameter is required."))
function CanPing {
$error.Clear()
$Error.Clear()
$tmp = Test-Connection $computername -ErrorAction SilentlyContinue
if (!$?)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ data to a text file.

```powershell
Register-EngineEvent -SourceIdentifier MyEventSource -Action {
"Event: {0}" -f $event.MessageData | Out-File c:\temp\MyEvents.txt -Append
"Event: {0}" -f $Event.MessageData | Out-File c:\temp\MyEvents.txt -Append
}
Start-Job -Name TestJob -ScriptBlock {
Expand Down
6 changes: 3 additions & 3 deletions reference/7.4/CimCmdlets/Register-CimIndicationEvent.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,12 @@ Register-CimIndicationEvent -Query $query -SourceIdentifier "Timer"
### Example 3: Run a script when the event arrives

This example shows how to use an action in response to an event. The variable `$action` holds the
script block for **Action**, which uses the `$event` variable to access the event received from CIM.
script block for **Action**, which uses the `$Event` variable to access the event received from CIM.

```powershell
$action = {
$name = $event.SourceEventArgs.NewEvent.ProcessName
$id = $event.SourceEventArgs.NewEvent.ProcessId
$name = $Event.SourceEventArgs.NewEvent.ProcessName
$id = $Event.SourceEventArgs.NewEvent.ProcessId
Write-Host -Object "New Process Started : Name = $name ID = $id"
}
$event = @{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ You can use this parameter to create a variable that contains only error
messages from specific commands and doesn't affect the behavior of the `$Error`
automatic variable. The `$Error` automatic variable contains error messages
from all the commands in the session. You can use array notation, such as
`$a[0]` or `$error[1,2]` to refer to specific errors stored in the variables.
`$a[0]` or `$Error[1,2]` to refer to specific errors stored in the variables.

> [!NOTE]
> The custom error variable contains all errors generated by the command,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ For example:
```

```Output
"PS $($executionContext.SessionState.Path.CurrentLocation)$('>' * ($nestedPromptLevel + 1)) "
"PS $($ExecutionContext.SessionState.Path.CurrentLocation)$('>' * ($nestedPromptLevel + 1)) "
# .Link
# https://go.microsoft.com/fwlink/?LinkID=225750
# .ExternalHelp System.Management.Automation.dll-help.xml
Expand Down Expand Up @@ -114,7 +114,7 @@ PowerShell includes a built-in `Prompt` function.

```powershell
function prompt {
"PS $($executionContext.SessionState.Path.CurrentLocation)$('>' * ($nestedPromptLevel + 1)) ";
"PS $($ExecutionContext.SessionState.Path.CurrentLocation)$('>' * ($nestedPromptLevel + 1)) ";
# .Link
# https://go.microsoft.com/fwlink/?LinkID=225750
# .ExternalHelp System.Management.Automation.dll-help.xml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ The following example shows a `Test-Remote.ps1` script that has a
param ($ComputerName = $(throw "ComputerName parameter is required."))
function CanPing {
$error.Clear()
$Error.Clear()
$tmp = Test-Connection $computername -ErrorAction SilentlyContinue
if (!$?)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ data to a text file.

```powershell
Register-EngineEvent -SourceIdentifier MyEventSource -Action {
"Event: {0}" -f $event.MessageData | Out-File c:\temp\MyEvents.txt -Append
"Event: {0}" -f $Event.MessageData | Out-File c:\temp\MyEvents.txt -Append
}
Start-Job -Name TestJob -ScriptBlock {
Expand Down
6 changes: 3 additions & 3 deletions reference/7.5/CimCmdlets/Register-CimIndicationEvent.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,12 @@ Register-CimIndicationEvent -Query $query -SourceIdentifier "Timer"
### Example 3: Run a script when the event arrives

This example shows how to use an action in response to an event. The variable `$action` holds the
script block for **Action**, which uses the `$event` variable to access the event received from CIM.
script block for **Action**, which uses the `$Event` variable to access the event received from CIM.

```powershell
$action = {
$name = $event.SourceEventArgs.NewEvent.ProcessName
$id = $event.SourceEventArgs.NewEvent.ProcessId
$name = $Event.SourceEventArgs.NewEvent.ProcessName
$id = $Event.SourceEventArgs.NewEvent.ProcessId
Write-Host -Object "New Process Started : Name = $name ID = $id"
}
$event = @{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ You can use this parameter to create a variable that contains only error
messages from specific commands and doesn't affect the behavior of the `$Error`
automatic variable. The `$Error` automatic variable contains error messages
from all the commands in the session. You can use array notation, such as
`$a[0]` or `$error[1,2]` to refer to specific errors stored in the variables.
`$a[0]` or `$Error[1,2]` to refer to specific errors stored in the variables.

> [!NOTE]
> The custom error variable contains all errors generated by the command,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ For example:
```

```Output
"PS $($executionContext.SessionState.Path.CurrentLocation)$('>' * ($nestedPromptLevel + 1)) "
"PS $($ExecutionContext.SessionState.Path.CurrentLocation)$('>' * ($nestedPromptLevel + 1)) "
# .Link
# https://go.microsoft.com/fwlink/?LinkID=225750
# .ExternalHelp System.Management.Automation.dll-help.xml
Expand Down Expand Up @@ -115,7 +115,7 @@ PowerShell includes a built-in `Prompt` function.

```powershell
function prompt {
"PS $($executionContext.SessionState.Path.CurrentLocation)$('>' * ($nestedPromptLevel + 1)) ";
"PS $($ExecutionContext.SessionState.Path.CurrentLocation)$('>' * ($nestedPromptLevel + 1)) ";
# .Link
# https://go.microsoft.com/fwlink/?LinkID=225750
# .ExternalHelp System.Management.Automation.dll-help.xml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ The following example shows a `Test-Remote.ps1` script that has a
param ($ComputerName = $(throw "ComputerName parameter is required."))
function CanPing {
$error.Clear()
$Error.Clear()
$tmp = Test-Connection $computername -ErrorAction SilentlyContinue
if (!$?)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ data to a text file.

```powershell
Register-EngineEvent -SourceIdentifier MyEventSource -Action {
"Event: {0}" -f $event.MessageData | Out-File c:\temp\MyEvents.txt -Append
"Event: {0}" -f $Event.MessageData | Out-File c:\temp\MyEvents.txt -Append
}
Start-Job -Name TestJob -ScriptBlock {
Expand Down
6 changes: 3 additions & 3 deletions reference/7.6/CimCmdlets/Register-CimIndicationEvent.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,12 @@ Register-CimIndicationEvent -Query $query -SourceIdentifier "Timer"
### Example 3: Run a script when the event arrives

This example shows how to use an action in response to an event. The variable `$action` holds the
script block for **Action**, which uses the `$event` variable to access the event received from CIM.
script block for **Action**, which uses the `$Event` variable to access the event received from CIM.

```powershell
$action = {
$name = $event.SourceEventArgs.NewEvent.ProcessName
$id = $event.SourceEventArgs.NewEvent.ProcessId
$name = $Event.SourceEventArgs.NewEvent.ProcessName
$id = $Event.SourceEventArgs.NewEvent.ProcessId
Write-Host -Object "New Process Started : Name = $name ID = $id"
}
$event = @{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ You can use this parameter to create a variable that contains only error
messages from specific commands and doesn't affect the behavior of the `$Error`
automatic variable. The `$Error` automatic variable contains error messages
from all the commands in the session. You can use array notation, such as
`$a[0]` or `$error[1,2]` to refer to specific errors stored in the variables.
`$a[0]` or `$Error[1,2]` to refer to specific errors stored in the variables.

> [!NOTE]
> The custom error variable contains all errors generated by the command,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ For example:
```

```Output
"PS $($executionContext.SessionState.Path.CurrentLocation)$('>' * ($nestedPromptLevel + 1)) "
"PS $($ExecutionContext.SessionState.Path.CurrentLocation)$('>' * ($nestedPromptLevel + 1)) "
# .Link
# https://go.microsoft.com/fwlink/?LinkID=225750
# .ExternalHelp System.Management.Automation.dll-help.xml
Expand Down Expand Up @@ -115,7 +115,7 @@ PowerShell includes a built-in `Prompt` function.

```powershell
function prompt {
"PS $($executionContext.SessionState.Path.CurrentLocation)$('>' * ($nestedPromptLevel + 1)) ";
"PS $($ExecutionContext.SessionState.Path.CurrentLocation)$('>' * ($nestedPromptLevel + 1)) ";
# .Link
# https://go.microsoft.com/fwlink/?LinkID=225750
# .ExternalHelp System.Management.Automation.dll-help.xml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ The following example shows a `Test-Remote.ps1` script that has a
param ($ComputerName = $(throw "ComputerName parameter is required."))
function CanPing {
$error.Clear()
$Error.Clear()
$tmp = Test-Connection $computername -ErrorAction SilentlyContinue
if (!$?)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ data to a text file.

```powershell
Register-EngineEvent -SourceIdentifier MyEventSource -Action {
"Event: {0}" -f $event.MessageData | Out-File c:\temp\MyEvents.txt -Append
"Event: {0}" -f $Event.MessageData | Out-File c:\temp\MyEvents.txt -Append
}
Start-Job -Name TestJob -ScriptBlock {
Expand Down
Loading