Miscellaneous minor updates to WinCompat#11980
Merged
iSazonov merged 5 commits intoPowerShell:masterfrom Mar 10, 2020
Merged
Conversation
iSazonov
approved these changes
Mar 1, 2020
SteveL-MSFT
requested changes
Mar 2, 2020
test/powershell/Modules/Microsoft.PowerShell.Core/CompatiblePSEditions.Module.Tests.ps1
Show resolved
Hide resolved
SteveL-MSFT
approved these changes
Mar 4, 2020
|
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. |
Author
|
@iSazonov looks like this is ready for merge. |
|
🎉 Handy links: |
|
🎉 Handy links: |
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
22 tasks
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Summary
Several small fixes to some WinCompat scenarios:
Removing PS-Core-specific paths from
PSModulePathof WinCompat process (Windows PS). Similar change was done previously by Allowpwshto inherit$env:PSModulePathand enablepowershell.exeto start correctly #11057 for NativeCommandProcessor. This PR enables samePSModulePathbehavior 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.Some implicit WinCompat scenarios were ignoring
-NoClobberand-Scopeparameters. This is now fixed.Get-PSSession -Namegenerates an error when the session is not found (in addition to returning nothing). When WinCompat usesGet-PSSessionto search for existingWinPSCompatSessionsession to reuse, such error is not shown to the user but it is written to the error stream. Considering that it is normal forWinPSCompatSessionsession 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 doGet-PSSession -Name WinPSCompatSession -ErrorAction Ignore.Fix The remote session with the name WinPSCompatSession is not available #11903
Fixed a test bug in
ModulePath.Tests.ps1.PR Checklist
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright headerWIP:or[ WIP ]to the beginning of the title (theWIPbot will keep its status check atPendingwhile the prefix is present) and remove the prefix when the PR is ready.