You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Tests (especially Get-FileHash) depend on machine-specific details #6413
There are a number of tests in the PowerShell test suite that depend on a file asset in a way that depends on the specific bytes of the file. These tests fail on platforms that somehow differ from the expected encodings. For example, my Git configuration converts LF line endings to CRLF locally on Windows when checking out (and converts back on check-in), which is the default Git configuration on Windows, but because of this and Windows introducing a BOM, my file hashes come out differently.
I've made a small list of the tests I see failing on my machine because of this:
Get-FileHash tests depend on file encoding -- CRLF/BOM breaks it
A Get-Process test depends on having a process with the name "notepad"
Write-Error ErrorRecord tests seem to be affected (get 11 and not the expected 4)
Get-PSSessionConfiguration assumes there is only a single PSSessionConfiguration on the machine
NativeStreams testing using the $longtext like in the Write-Error tests have a similar outcome
There might be a couple more tests like this too (I will update if I find any).
For the string/encoding-dependent tests, my suggestion is to use byte streams directly instead.
Steps to reproduce
cd $powershellBuildDirImport-Module ./build.psm1
cd ./test/powershell/Modules/Microsoft.PowerShell.Utility
Start-PSPesterGet-FileHash.Tests.ps1
Expected behavior
Get-FileHash tests pass.
Actual behavior
Hashes all come out differently
Environment data
>$PSVersionTable
Name Value
---------
PSVersion 6.0.1
PSEdition Core
GitCommitId v6.0.1-261-g71cb49a99d00ae4257e63f6564fd122325b64a48
OS Microsoft Windows 10.0.16299
Platform Win32NT
PSCompatibleVersions {1.0,2.0,3.0,4.0...}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.
microsoft-github-policy-service commented on Nov 16, 2023
This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.
This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.
microsoft-github-policy-service commented on Nov 23, 2023
Activity
rjmholt commentedon Mar 16, 2018
This may be the cause of #5960 and #6369.
microsoft-github-policy-service commentedon Nov 16, 2023
This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.
microsoft-github-policy-service commentedon Nov 16, 2023
This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.
microsoft-github-policy-service commentedon Nov 16, 2023
This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.
microsoft-github-policy-service commentedon Nov 23, 2023
This issue has been marked as "No Activity" as there has been no activity for 6 months. It has been closed for housekeeping purposes.