Add LocationChangedAction handler and tests to support the Windows Compat module. - #7552
Merged
Travis Plunk (TravisEz13) merged 3 commits intoAug 22, 2018
Merged
Conversation
Bruce Payette (BrucePay)
requested a review
from Dongbo Wang (daxian-dbw)
as a code owner
August 17, 2018 00:47
Ilya (iSazonov)
left a comment
Collaborator
There was a problem hiding this comment.
Bruce Payette (@BrucePay) Please address CodeFactor issues for your new code and public comments.
| (Get-Variable newPath).Value = $_.newPath | ||
| } | ||
| Set-Location .. | ||
| $newPath.Path | Should Be $pwd.Path |
Collaborator
There was a problem hiding this comment.
Please use new Pester syntax - Should -Be.
Below too.
Collaborator
Author
There was a problem hiding this comment.
Oops. Yeah - I'll fix that. Thanks.
Rob Holt (rjmholt)
approved these changes
Aug 17, 2018
Rob Holt (rjmholt)
left a comment
Collaborator
There was a problem hiding this comment.
This looks good to me, modulo Ilya (@iSazonov)'s Pester comment
…uld -Be' in the tests.
| Set-Location .. | ||
| $ExecutionContext.InvokeCommand.LocationChangedAction = { throw "Boom" } | ||
| # Verify that the exception occurred | ||
| { Set-Location $location } | Should Throw "Boom" |
Collaborator
There was a problem hiding this comment.
Ideally this should be Should -Throw -ErrorId "Boom" here
Ilya (iSazonov)
approved these changes
Aug 20, 2018
Ilya (iSazonov)
left a comment
Collaborator
There was a problem hiding this comment.
LGTM with one comment about -Throw.
|
Travis Plunk (@TravisEz13) This looks read for merge. |
Merged
11 tasks
Thatgfsj (Thatgfsj)
pushed a commit
to Thatgfsj-contribs/PowerShell
that referenced
this pull request
Aug 6, 2026
…Compat module (PowerShell#7552) Add LocationChangedAction handler and tests to support the Windows Compat module.
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
Fix for #7551. Implemented a new action
LocationChangedActionthat fires when the current directory in a runspace is changed.PR Checklist
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright headerWIP:to the beginning of the title and remove the prefix when the PR is ready.[feature]if the change is significant or affects feature tests