Prerequisites
Links
Summary
The Microsoft Learn documentation for Write-Host (PowerShell 7.6) incorrectly states that the -Object parameter has Value from remaining arguments: False.
In the actual PowerShell 7.6.0 source, -Object is declared with ValueFromRemainingArguments = true:
https://github.com/PowerShell/PowerShell/blob/v7.6.0/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WriteConsoleCmdlet.cs#L20
That matches runtime behavior: multiple positional values are collected into -Object, e.g. Write-Host a b c works, and -Separator applies between them. Local Get-Help Write-Host -Parameter Object also reports FromRemainingArguments.
Doc page: https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/write-host?view=powershell-7.6
Expected fix: update the -Object parameter metadata so Value from remaining arguments is True (and ideally note Accept pipeline input: True (ByValue, FromRemainingArguments) for consistency with Get-Help).
Details
The Learn page for Write-Host (7.6) shows -Object with:
- Value from remaining arguments: False
But in PowerShell v7.6.0 source, -Object is:
[Parameter(Position = 0, ValueFromRemainingArguments = true, ValueFromPipeline = true)]
Runtime behavior matches the source, e.g.:
Write-Host a b c -Separator ' | '
# a | b | c
Suggested Fix
Suggested Fix
Update the -Object parameter metadata in the 7.6 (and any other affected version) docs so Value from remaining arguments is True.
Prerequisites
Get-Foocmdlet" instead of "Typo."Links
Summary
The Microsoft Learn documentation for Write-Host (PowerShell 7.6) incorrectly states that the -Object parameter has Value from remaining arguments: False.
In the actual PowerShell 7.6.0 source, -Object is declared with ValueFromRemainingArguments = true:
https://github.com/PowerShell/PowerShell/blob/v7.6.0/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WriteConsoleCmdlet.cs#L20
That matches runtime behavior: multiple positional values are collected into -Object, e.g. Write-Host a b c works, and -Separator applies between them. Local Get-Help Write-Host -Parameter Object also reports FromRemainingArguments.
Doc page: https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/write-host?view=powershell-7.6
Expected fix: update the -Object parameter metadata so Value from remaining arguments is True (and ideally note Accept pipeline input: True (ByValue, FromRemainingArguments) for consistency with Get-Help).
Details
The Learn page for Write-Host (7.6) shows
-Objectwith:But in PowerShell v7.6.0 source,
-Objectis:[Parameter(Position = 0, ValueFromRemainingArguments = true, ValueFromPipeline = true)]Runtime behavior matches the source, e.g.:
Suggested Fix
Suggested Fix
Update the
-Objectparameter metadata in the 7.6 (and any other affected version) docs so Value from remaining arguments is True.