Skip to content

Update UseNewEnvironment parameter behavior of Start-Process cmdlet on Windows #10830

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

iSazonov
Copy link
Collaborator

@iSazonov iSazonov commented Oct 18, 2019

PR Summary

The PR effects only Windows behavior.

PR Context

Replace #10561
Fix #3545
Fix partially #4671

PowerShell Committee conclusion #10745 (comment)

PR Checklist

@iSazonov iSazonov added Breaking-Change breaking change that may affect users Committee-Reviewed PS-Committee has reviewed this and made a decision CL-BreakingChange Indicates that a PR should be marked as a breaking change in the Change Log CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log labels Oct 18, 2019
@iSazonov iSazonov added this to the 7.0.0-preview.5 milestone Oct 18, 2019
@iSazonov iSazonov requested a review from PaulHigin October 18, 2019 11:40
@iSazonov iSazonov force-pushed the update-usenewenvironment-2 branch from 92fd170 to 2f40ad7 Compare October 18, 2019 11:42
$env:TestEnvVariable = 1

try {
Start-Process $PWSH -ArgumentList '-NoProfile','-Command Write-Output $env:TestEnvVariable' -RedirectStandardOutput $outputFile -Wait
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use of CreateEnvironmentBlock() with the user token is great. Did you verify that USERNAME is correct and PATH is complete?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could check USERNAME. Checking PATH it would be that we don't trust native API.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@iSazonov iSazonov added the Documentation Needed in this repo Documentation is needed in this repo label Oct 19, 2019
@iSazonov iSazonov force-pushed the update-usenewenvironment-2 branch from ddd07ba to ec03e45 Compare October 21, 2019 12:09
@iSazonov
Copy link
Collaborator Author

iSazonov commented Feb 4, 2020

@TravisEz13 @anmenaga @SteveL-MSFT Could you please review?

@ghost ghost added Waiting on Author The PR was reviewed and requires changes or comments from the author before being accept and removed Waiting on Author The PR was reviewed and requires changes or comments from the author before being accept labels Feb 4, 2020
@TravisEz13 TravisEz13 dismissed their stale review February 5, 2020 23:24

Not applicable

@iSazonov iSazonov force-pushed the update-usenewenvironment-2 branch from 43b2149 to cffeaa5 Compare March 29, 2020 08:09
@iSazonov iSazonov force-pushed the update-usenewenvironment-2 branch from cffeaa5 to 0f2b8ae Compare April 8, 2020 16:53
@adityapatwardhan
Copy link
Member

@iSazonov would it be possible to validate these changes on nano server?

@iSazonov
Copy link
Collaborator Author

would it be possible to validate these changes on nano server?

Oh, I never have nano. Sorry.

@adityapatwardhan
Copy link
Member

Verified it works on docker image for nanoserver.

@adityapatwardhan adityapatwardhan merged commit 264bcb3 into PowerShell:master Apr 18, 2020
@iSazonov iSazonov deleted the update-usenewenvironment-2 branch April 18, 2020 08:12
@ghost
Copy link

ghost commented Apr 23, 2020

🎉v7.1.0-preview.2 has been released which incorporates this pull request.:tada:

Handy links:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Breaking-Change breaking change that may affect users CL-BreakingChange Indicates that a PR should be marked as a breaking change in the Change Log CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log Committee-Reviewed PS-Committee has reviewed this and made a decision
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Start-Process fails to launch new powershell.exe instance with -UseNewEnvironment switch
6 participants