Skip to content

NewLine is added to output when told to explicitly drop NewLine #15222

@johnjelinek

Description

@johnjelinek

A newline is getting added to the output when running echo even if I tell it not to (with -n flag). It also looks like Write-Out doesn't support -NoNewLine.

Steps to reproduce

echo 'hello' | base64

Expected behavior

> echo 'hello' | base64
aGVsbG8K
> echo -n 'hello' | base64
aGVsbG8=

Actual behavior

> echo 'hello' | base64
aGVsbG8K
> echo -n 'hello' | base64
aGVsbG8K

Environment data

> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      7.1.3
PSEdition                      Core
GitCommitId                    7.1.3
OS                             Darwin 19.6.0 Darwin Kernel Version 19.6.0: Tue Jan 12 22:13:05 PST 2021; root:xnu-6153.141.16~1/RELEASE_X86_64
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs-TriageThe issue is new and needs to be triaged by a work group.Resolution-No ActivityIssue has had no activity for 6 months or moreWG-Cmdlets-Utilitycmdlets in the Microsoft.PowerShell.Utility module

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions