Skip to content

Commit

Permalink
(GH-11332) Fix pager info for built-in help function
Browse files Browse the repository at this point in the history
Prior to this change, the documentation for the built-in
`help` function in `about_Built-in_Functions` incorrectly
stated that PowerShell always uses `more` for the pager
on Windows and the `PAGER` environment variable on
non-Windows systems.

This change:

- Clarifies that PowerShell uses a default pager for both
  Windows (`more`) and non-Windows (`less`) systems.
- Clarifies that when the `PAGER` environment variable is
  defined, PowerShell uses that command instead of the
  default pager on both Windows and non-Windows systems.
- Fixes AB#297346
- Resolves #11332
  • Loading branch information
michaeltlombardi committed Aug 14, 2024
1 parent 04a9889 commit ba87b8a
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
description: Describes the built-in functions in PowerShell.
Locale: en-US
ms.date: 06/13/2024
ms.date: 08/14/2024
online version: https://learn.microsoft.com/powershell/module/Microsoft.PowerShell.Core/about/about_built-in_functions?view=powershell-5.1&WT.mc_id=ps-gethelp
schema: 2.0.0
title: about Built-in Functions
Expand Down Expand Up @@ -46,7 +46,7 @@ more information, see [Get-Verb](xref:Microsoft.PowerShell.Core.Get-Verb)
## `help`

This function invokes `Get-Help` with your parameters and passes the output to
the systems pager command, `more.com`.
the system's pager command, `more.com`.

## `ImportSystemModules`

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
description: Describes the built-in functions in PowerShell.
Locale: en-US
ms.date: 06/13/2024
ms.date: 08/14/2024
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_built-in_functions?view=powershell-7.2&WT.mc_id=ps-gethelp
schema: 2.0.0
title: about Built-in Functions
Expand Down Expand Up @@ -41,9 +41,12 @@ The script pauses execution and prompts the user to hit a key to continue.
## `help`

This function invokes `Get-Help` with your parameters and passes the output to
the systems pager command. On Windows systems, the pager is `more.com`. On
non-Windows systems, `help` uses the pager defined by the `$env:PAGER`
environment variable.
the system's pager command. PowerShell uses a different default pager for
Windows and non-Windows systems. On Windows systems, the default pager is
`more.com`. On non-Windows systems, the default pager is `less`.

If the `$env:PAGER` environment variable is defined, PowerShell uses the
specified program instead of the system default.

## `prompt`

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
description: Describes the built-in functions in PowerShell.
Locale: en-US
ms.date: 06/13/2024
ms.date: 08/14/2024
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_built-in_functions?view=powershell-7.4&WT.mc_id=ps-gethelp
schema: 2.0.0
title: about Built-in Functions
Expand Down Expand Up @@ -49,9 +49,12 @@ The script pauses execution and prompts the user to hit a key to continue.
## `help`

This function invokes `Get-Help` with your parameters and passes the output to
the systems pager command. On Windows systems, the pager is `more.com`. On
non-Windows systems, `help` uses the pager defined by the `$env:PAGER`
environment variable.
the system's pager command. PowerShell uses a different default pager for
Windows and non-Windows systems. On Windows systems, the default pager is
`more.com`. On non-Windows systems, the default pager is `less`.

If the `$env:PAGER` environment variable is defined, PowerShell uses the
specified program instead of the system default.

## `prompt`

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
description: Describes the built-in functions in PowerShell.
Locale: en-US
ms.date: 06/13/2024
ms.date: 08/14/2024
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_built-in_functions?view=powershell-7.5&WT.mc_id=ps-gethelp
schema: 2.0.0
title: about Built-in Functions
Expand Down Expand Up @@ -49,9 +49,12 @@ The script pauses execution and prompts the user to hit a key to continue.
## `help`

This function invokes `Get-Help` with your parameters and passes the output to
the systems pager command. On Windows systems, the pager is `more.com`. On
non-Windows systems, `help` uses the pager defined by the `$env:PAGER`
environment variable.
the system's pager command. PowerShell uses a different default pager for
Windows and non-Windows systems. On Windows systems, the default pager is
`more.com`. On non-Windows systems, the default pager is `less`.

If the `$env:PAGER` environment variable is defined, PowerShell uses the
specified program instead of the system default.

## `prompt`

Expand Down

0 comments on commit ba87b8a

Please sign in to comment.