{{ message }}
Fix Export-PSSession to not throw error when a rooted path is specified for -OutputModule#17671
Merged
daxian-dbw merged 3 commits intoPowerShell:masterfrom Jul 13, 2022
Merged
Conversation
…ed for -OutputModule
SteveL-MSFT
reviewed
Jul 13, 2022
TravisEz13
approved these changes
Jul 13, 2022
PaulHigin
suggested changes
Jul 13, 2022
Co-authored-by: Aditya Patwardhan <adityap@microsoft.com>
PaulHigin
approved these changes
Jul 13, 2022
SteveL-MSFT
approved these changes
Jul 13, 2022
adityapatwardhan
approved these changes
Jul 13, 2022
Collaborator
|
🎉 Handy links: |
Member
|
/backport release/v7.2.6 |
Member
|
/backport to release/v7.0.12 |
Contributor
|
Started backporting to release/v7.0.12: https://github.com/PowerShell/PowerShell/actions/runs/2784794011
|
Member
|
/backport to release/v7.2.6 |
Contributor
|
@adityapatwardhan backporting to release/v7.0.12 failed, the patch most likely resulted in conflicts: $ git am --3way --ignore-whitespace --keep-non-patch changes.patch
Applying: Fix Export-PSSession to not throw error when a rooted path is specified for -OutputModule
Applying: Update comment
error: sha1 information is lacking or useless (src/System.Management.Automation/utils/PathUtils.cs).
error: could not build fake ancestor
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0002 Update comment
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
Error: The process '/usr/bin/git' failed with exit code 128Please backport manually! |
Contributor
|
Started backporting to release/v7.2.6: https://github.com/PowerShell/PowerShell/actions/runs/2784796745
|
1 task
|
🎉 Handy links: |
22 tasks
5 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
The 7.0.10 release contains a commit for a potential security issue: 38e55e1. Here is the announcement about it: PowerShell/Announcements#31.
This particular change from that commit caused a regression in Azure Function when running
Import-Module <module-name> -UseWindowsPowerShell, where the user's module path doesn't exist. That command worked fine with the PowerShell 7.0.9 SDK but started to fail with the PowerShell 7.0.11 SDK.The root cause is that when
Export-PSSessionis used byImport-Module -UseWindowsPowerShell, a rooted path is always specified to the-OutputModuleparameter, so it doesn't matter whether the user's module path exists or not because it doesn't need it to identify the directory to use.The fix is to use the specified rooted path directly. Actually,
Path.Combine(path1, path2)will returnpath2if it's rooted.The error message is also updated:
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.