10000 Start-Process fails to launch new powershell.exe instance with -UseNewEnvironment switch · Issue #3545 · PowerShell/PowerShell · GitHub
[go: up one dir, main page]

Skip to content
Start-Process fails to launch new powershell.exe instance with -UseNewEnvironment switch #3545
@0xfeeddeadbeef

Description

@0xfeeddeadbeef

Steps to reproduce

I dont know why would anyone do this, but here it goes: you cannot launch another powershell.exe using Start-Process cmdlet with -UseNewEnvironment switch.

Windows PowerShell:

Start-Process -FilePath C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoNewWindow -UseNewEnvironment

PowerShell Core (Debug build):

Start-Process -FilePath .\powershell.exe -NoNewWindow -UseNewEnvironment

Expected behavior

A new instance of powershell.exe console should start.

Actual behavior

Windows PowerShell outputs error and dies:

Internal Windows PowerShell error.  Loading managed Windows PowerShell failed with error 8009001d.

PowerShell Core (Debug build) outputs more errors + assert message and dies:

Error resolving full path []
Error resolving full path []
PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

The shell cannot be started. A failure occurred during initialization:
ASSERT: caller makes sure it's not null or empty

Environment data

> $PSVersionTable
Name                           Value
----                           -----
PSVersion                      5.1.14409.1005
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.14409.1005
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

> $PSVersionTable
Name                           Value
----                           -----
PSVersion                      6.0.0-alpha
GitCommitId                    v6.0.0-alpha.18-9-g8d4db01a5d4b5dcd981ef216d3d7f24b484c7c60-dirty
WSManStackVersion              3.0
CLRVersion
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   3.0.0.0
PSRemotingProtocolVersion      2.3
PSEdition                      Core
SerializationVersion           1.1.0.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Resolution-FixedThe issue is fixed.Up-for-GrabsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsWG-Interactive-Consolethe console experience

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0