diff --git a/.github/actions/.pwsh/module/functions/utility/Get-GHAConsoleError.ps1 b/.github/actions/.pwsh/module/functions/utility/Get-GHAConsoleError.ps1 index d7fcc0fabf2d..51b37446f8b3 100644 --- a/.github/actions/.pwsh/module/functions/utility/Get-GHAConsoleError.ps1 +++ b/.github/actions/.pwsh/module/functions/utility/Get-GHAConsoleError.ps1 @@ -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 @@ -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. diff --git a/.github/actions/.pwsh/module/readme.md b/.github/actions/.pwsh/module/readme.md index f6466fd6957e..996fa40c58d7 100644 --- a/.github/actions/.pwsh/module/readme.md +++ b/.github/actions/.pwsh/module/readme.md @@ -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] diff --git a/reference/5.1/CimCmdlets/Register-CimIndicationEvent.md b/reference/5.1/CimCmdlets/Register-CimIndicationEvent.md index d619ecd815d6..b8d5e37c204d 100644 --- a/reference/5.1/CimCmdlets/Register-CimIndicationEvent.md +++ b/reference/5.1/CimCmdlets/Register-CimIndicationEvent.md @@ -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 = @{ diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_CommonParameters.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_CommonParameters.md index 65c5a4abfd5b..69316a926fbf 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_CommonParameters.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_CommonParameters.md @@ -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, diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Prompts.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Prompts.md index 7729bd81989b..c9968ac1626f 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Prompts.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Prompts.md @@ -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 @@ -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 diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Scripts.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Scripts.md index 9e6b514c8818..f17e85c8367a 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Scripts.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Scripts.md @@ -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 (!$?) diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Register-EngineEvent.md b/reference/5.1/Microsoft.PowerShell.Utility/Register-EngineEvent.md index 501f2dd1849d..27115530b31c 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Register-EngineEvent.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Register-EngineEvent.md @@ -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 { diff --git a/reference/7.4/CimCmdlets/Register-CimIndicationEvent.md b/reference/7.4/CimCmdlets/Register-CimIndicationEvent.md index 575d23798867..db58a3c53c3a 100644 --- a/reference/7.4/CimCmdlets/Register-CimIndicationEvent.md +++ b/reference/7.4/CimCmdlets/Register-CimIndicationEvent.md @@ -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 = @{ diff --git a/reference/7.4/Microsoft.PowerShell.Core/About/about_CommonParameters.md b/reference/7.4/Microsoft.PowerShell.Core/About/about_CommonParameters.md index 776abbac7231..6c321880ff3f 100644 --- a/reference/7.4/Microsoft.PowerShell.Core/About/about_CommonParameters.md +++ b/reference/7.4/Microsoft.PowerShell.Core/About/about_CommonParameters.md @@ -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, diff --git a/reference/7.4/Microsoft.PowerShell.Core/About/about_Prompts.md b/reference/7.4/Microsoft.PowerShell.Core/About/about_Prompts.md index 351b10b2f831..930f9f8b3b5a 100644 --- a/reference/7.4/Microsoft.PowerShell.Core/About/about_Prompts.md +++ b/reference/7.4/Microsoft.PowerShell.Core/About/about_Prompts.md @@ -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 @@ -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 diff --git a/reference/7.4/Microsoft.PowerShell.Core/About/about_Scripts.md b/reference/7.4/Microsoft.PowerShell.Core/About/about_Scripts.md index 3301c8a4bb41..2fa5f7f8fc26 100644 --- a/reference/7.4/Microsoft.PowerShell.Core/About/about_Scripts.md +++ b/reference/7.4/Microsoft.PowerShell.Core/About/about_Scripts.md @@ -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 (!$?) diff --git a/reference/7.4/Microsoft.PowerShell.Utility/Register-EngineEvent.md b/reference/7.4/Microsoft.PowerShell.Utility/Register-EngineEvent.md index 83697d20fb5e..b5494d928904 100644 --- a/reference/7.4/Microsoft.PowerShell.Utility/Register-EngineEvent.md +++ b/reference/7.4/Microsoft.PowerShell.Utility/Register-EngineEvent.md @@ -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 { diff --git a/reference/7.5/CimCmdlets/Register-CimIndicationEvent.md b/reference/7.5/CimCmdlets/Register-CimIndicationEvent.md index 46816b9697dc..6f50cec7c223 100644 --- a/reference/7.5/CimCmdlets/Register-CimIndicationEvent.md +++ b/reference/7.5/CimCmdlets/Register-CimIndicationEvent.md @@ -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 = @{ diff --git a/reference/7.5/Microsoft.PowerShell.Core/About/about_CommonParameters.md b/reference/7.5/Microsoft.PowerShell.Core/About/about_CommonParameters.md index 496f77769b7e..0585d21ae183 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/About/about_CommonParameters.md +++ b/reference/7.5/Microsoft.PowerShell.Core/About/about_CommonParameters.md @@ -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, diff --git a/reference/7.5/Microsoft.PowerShell.Core/About/about_Prompts.md b/reference/7.5/Microsoft.PowerShell.Core/About/about_Prompts.md index b161092d528e..85412ae8ab71 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/About/about_Prompts.md +++ b/reference/7.5/Microsoft.PowerShell.Core/About/about_Prompts.md @@ -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 @@ -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 diff --git a/reference/7.5/Microsoft.PowerShell.Core/About/about_Scripts.md b/reference/7.5/Microsoft.PowerShell.Core/About/about_Scripts.md index c626ce066773..67103599e6a2 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/About/about_Scripts.md +++ b/reference/7.5/Microsoft.PowerShell.Core/About/about_Scripts.md @@ -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 (!$?) diff --git a/reference/7.5/Microsoft.PowerShell.Utility/Register-EngineEvent.md b/reference/7.5/Microsoft.PowerShell.Utility/Register-EngineEvent.md index 12e18d7e3525..de8cb7653af1 100644 --- a/reference/7.5/Microsoft.PowerShell.Utility/Register-EngineEvent.md +++ b/reference/7.5/Microsoft.PowerShell.Utility/Register-EngineEvent.md @@ -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 { diff --git a/reference/7.6/CimCmdlets/Register-CimIndicationEvent.md b/reference/7.6/CimCmdlets/Register-CimIndicationEvent.md index 379be06226e4..758b2eaa61b8 100644 --- a/reference/7.6/CimCmdlets/Register-CimIndicationEvent.md +++ b/reference/7.6/CimCmdlets/Register-CimIndicationEvent.md @@ -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 = @{ diff --git a/reference/7.6/Microsoft.PowerShell.Core/About/about_CommonParameters.md b/reference/7.6/Microsoft.PowerShell.Core/About/about_CommonParameters.md index 6ec72eda5175..1cc73dd2daaa 100644 --- a/reference/7.6/Microsoft.PowerShell.Core/About/about_CommonParameters.md +++ b/reference/7.6/Microsoft.PowerShell.Core/About/about_CommonParameters.md @@ -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, diff --git a/reference/7.6/Microsoft.PowerShell.Core/About/about_Prompts.md b/reference/7.6/Microsoft.PowerShell.Core/About/about_Prompts.md index 49f0051644de..ebeb1691f192 100644 --- a/reference/7.6/Microsoft.PowerShell.Core/About/about_Prompts.md +++ b/reference/7.6/Microsoft.PowerShell.Core/About/about_Prompts.md @@ -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 @@ -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 diff --git a/reference/7.6/Microsoft.PowerShell.Core/About/about_Scripts.md b/reference/7.6/Microsoft.PowerShell.Core/About/about_Scripts.md index 995a850a8937..1e69a5aea97b 100644 --- a/reference/7.6/Microsoft.PowerShell.Core/About/about_Scripts.md +++ b/reference/7.6/Microsoft.PowerShell.Core/About/about_Scripts.md @@ -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 (!$?) diff --git a/reference/7.6/Microsoft.PowerShell.Utility/Register-EngineEvent.md b/reference/7.6/Microsoft.PowerShell.Utility/Register-EngineEvent.md index b167ca949e5d..a496520bc10c 100644 --- a/reference/7.6/Microsoft.PowerShell.Utility/Register-EngineEvent.md +++ b/reference/7.6/Microsoft.PowerShell.Utility/Register-EngineEvent.md @@ -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 {