Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Piping Text To An External Program Appends A Trailing Newline #5974

Copy link
Copy link
@ThePieMonster

Description

@ThePieMonster
Issue body actions

Steps to reproduce

Run the below command in Linux, Command Prompt, and PowerShell and compare the output.

echo -n "string" | openssl dgst -sha256 -hmac "authcode"

I also attempted to change the encoding PowerShell was using to UTF-8 but that did not change the value of the returned hash.

[Console]::OutputEncoding = [Text.UTF8Encoding]::UTF8

Expected behavior

Linux/CMD Response: (stdin)= 54ef1d2effbc663eb6dc84a49cc1600b30e79f2e1ff737b99cd96589842d50e9
PowerShell Response:(stdin)= 54ef1d2effbc663eb6dc84a49cc1600b30e79f2e1ff737b99cd96589842d50e9

Actual behavior

Linux/CMD Response: (stdin)= 54ef1d2effbc663eb6dc84a49cc1600b30e79f2e1ff737b99cd96589842d50e9
PowerShell Response:(stdin)= 08daf0944f91c2d904ef9f231c4e767067c9b795197c4fe46631aa78c7e9d0c4

Environment data

> $PSVersionTable
Name                           Value                                                                                       
----                           -----                                                                                       
PSVersion                      5.1.16299.98                                                                                
PSEdition                      Desktop                                                                                     
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}                                                                     
BuildVersion                   10.0.16299.98                                                                               
CLRVersion                     4.0.30319.42000                                                                             
WSManStackVersion              3.0                                                                                         
PSRemotingProtocolVersion      2.3                                                                                         
SerializationVersion           1.1.0.1                                                                                     
Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-Discussionthe issue may not have a clear classification yet. The issue may generate an RFC or may be reclassifthe issue may not have a clear classification yet. The issue may generate an RFC or may be reclassifResolution-By DesignThe reported behavior is by design.The reported behavior is by design.WG-Enginecore PowerShell engine, interpreter, and runtimecore PowerShell engine, interpreter, and runtime

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    Done
    Show more project fields

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.