Skip to content

Tests should explicitly pass -NoProfile when launching powershell. #3881

@dantraMSFT

Description

@dantraMSFT

Steps to reproduce

Update the profile script to implicitly or explicitly write to the output stream.
Run the test\powershell\Modules\Microsoft.PowerShell.Core\Out-Default.Tests.ps1 tests.

Expected behavior

All tests pass

Actual behavior

All tests fail.

The pattern in the tests assumes running powershell -c 'somescript' will only produce output from the script. The output from the profile is unexpected and causes the tests to fail.

For these types of tests; -Profile should also be specified.

PSVersion                      6.0.0-beta
PSEdition                      Core
BuildVersion                   3.0.0.0
CLRVersion
GitCommitId                    v6.0.0-beta.1-21-g73dd94197b5f4fb7a4d2ece325199bfd5caa64b1-dirty
OS                             Microsoft Windows 10.0.16209
Platform                       Win32NT
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

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions