FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Miscellaneous minor updates to WinCompat by anmenaga · Pull Request #11980 · PowerShell/PowerShell · GitHub

Miscellaneous minor updates to WinCompat - #11980

Merged
Ilya (iSazonov) merged 5 commits into
PowerShell:masterfrom
anmenaga:TestB
Mar 10, 2020
Merged

Miscellaneous minor updates to WinCompat#11980
Ilya (iSazonov) merged 5 commits into
PowerShell:masterfrom
anmenaga:TestB

Conversation

Andrew (anmenaga) commented Feb 29, 2020
edited
Loading

Copy link
Copy Markdown

PR Summary

Several small fixes to some WinCompat scenarios:

  1. Removing PS-Core-specific paths from PSModulePath of WinCompat process (Windows PS). Similar change was done previously by Allow pwsh to inherit $env:PSModulePath and enable powershell.exe to start correctly #11057 for NativeCommandProcessor. This PR enables same
    PSModulePath behavior for WinCompat process (Windows PS) and job's process (Windows PS - for jobs started with -PSVersion 5.1). Without this change there could be bad cases when WinCompat process was loading PS-Core versions of the modules.

  2. Some implicit WinCompat scenarios were ignoring -NoClobber and -Scope parameters. This is now fixed.

  3. Get-PSSession -Name generates an error when the session is not found (in addition to returning nothing). When WinCompat uses Get-PSSession to search for existing WinPSCompatSession session to reuse, such error is not shown to the user but it is written to the error stream. Considering that it is normal for WinPSCompatSession session to not be there before the first WinCompat module import, such error is expected but it may confuse user if it is found in the error stream. The fix is to do Get-PSSession -Name WinPSCompatSession -ErrorAction Ignore.
    Fix The remote session with the name WinPSCompatSession is not available #11903

  4. Fixed a test bug in ModulePath.Tests.ps1.

PR Checklist

Andrew (anmenaga) added WG-Remoting PSRP issues with any transport layer CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log labels Feb 29, 2020
ghost assigned Ilya (iSazonov) Feb 29, 2020
ghost added the Waiting on Author The PR was reviewed and requires changes or comments from the author before being accept label Mar 2, 2020
ghost removed the Waiting on Author The PR was reviewed and requires changes or comments from the author before being accept label Mar 2, 2020

Cody Konior (codykonior) commented Mar 9, 2020
edited
Loading

Copy link
Copy Markdown

The Get-PSSession fix is critical for anyone who wants to run PS 7 in critical production environments and so uses $ErrorActionPreference = 'Stop'.

It cannot be overridden manually with -ErrorActionPreference:Continue; the only workaround is to set the variable to Continue and then run it, but then you require extra code to detect and parse if any errors occurred loading the module. Alternately, Import-WinModule can be used instead.

Hope this gets merged in and made available ASAP.

Copy link
Copy Markdown
Author

Ilya (@iSazonov) looks like this is ready for merge.

Ilya (iSazonov) merged commit 704b0e7 into PowerShell:master Mar 10, 2020

Copy link
Copy Markdown

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

Handy links:

Copy link
Copy Markdown

🎉v7.0.1 has been released which incorporates this pull request.:tada:

Handy links:

John Dennis (silijon) pushed a commit to SkyKick/PowerShell that referenced this pull request Jul 2, 2020
* Filter PSModulePath when starting PS 5.1. Removing PS-Core-specific paths from PSModulePath of WinCompat process (Windows PS).
* Make implicit WinCompat respect NoClobber and Scope parameters
* Add ErrorAction.Ignore when searching for WinPSCompatSession
# Conflicts:
#	src/System.Management.Automation/engine/Modules/ModuleCmdletBase.cs
Thatgfsj (Thatgfsj) pushed a commit to Thatgfsj/PowerShell that referenced this pull request Aug 6, 2026
* Filter PSModulePath when starting PS 5.1. Removing PS-Core-specific paths from PSModulePath of WinCompat process (Windows PS).
* Make implicit WinCompat respect NoClobber and Scope parameters
* Add ErrorAction.Ignore when searching for WinPSCompatSession
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log WG-Remoting PSRP issues with any transport layer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The remote session with the name WinPSCompatSession is not available

6 participants


Back | FazBrowse Home | New Git URL