Fix code-format and test invocation through PowerShell #10465
Merged
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.
Fixes the
Invoke-CodeFormat
andInvoke-OpenConsoleTests
functions inOpenConsole.psm1
so that they can be run directly from PowerShell.Addresses the issues found when creating #10447.
Invoke-CodeFormat
did not work when invoked directly from PowerShell due to a relative path being passed into the .NET function[IO.File]::WriteAllLines()
. The working directory for .NET objects does not change when you change directory in PowerShell, so the paths were being treated as relative to the initial working directory of the shell - which was not the terminal git repo.Invoke-OpenConsoleTests
had 3 issues:TestHostApp
was wrong.tests.xml
wasn't in sync with therunABC.cmd
files, so the remoting and control unit tests didn't run.Validation Steps Performed
Invoke-CodeFormat
andrunformat.cmd
from multiple directories and didn't see errors.Invoke-OpenConsoleTests
and didn't see errors.