When `$PSStyle.AutoSizeDefaultFormatting = $true`, the default implicit formatting applied by PowerShell (via `Out-Default`) will enforce `AutoSize` when the chosen formatting view is `table` or `wide`, similar to running `Format-Table -AutoSize` and `Format-Wide -AutoSize` explicitly. The `List` and `Complex` views formatting won't be buffered though -- they will continue to be streamed.
This allows PowerShell to generate less verbose output when used by an agent. It also makes PowerShell works better with small-window terminal.
Update the code that prepends `$PSHOME` to `PATH` to handle the MSIX package installation specially -- it uses the stable path that points to the `ExecutionAlias` of the MSIX installation instead of `$PSHOME`.
- Fix the scripts used for `Copy-Item -FromSessoin/-ToSession` and `PSEdit`. They use `-Encoding Byte`, which only works in PS5.1. In PS 7+, we need to use `-AsByteStream` instead. So, those scenarios (copy alternate data stream to/from remote PS 7 session and edit file from a remote PS 7 session) have been broken for a long time.
- The remote tests for `Copy-Item` have always been disabled. This PR re-enables those tests for Windows (the `HelperRemoting` module only works on Windows).
The method `GetLookupDirectoryPaths` always returns the cached instance of path collection. However, the returned collection gets mutated in `CommandPathSearch.ResolveCurrentDirectoryInLookupPaths` to resolve the relative paths such as `.\tools` based on the user's current working directory `$PWD`, so for example, `.\tools` gets replaced with `cwd-1\tools` in the cached instance. Then, when the user changes to a different working directory `cwd-2`, command discovery won't find the executable or ps1 script under `cwd-2/tools` as expected, but those executables under `cwd-1\tools` will always be discoverable no matter what the `$PWD` is. That behavior is incorrect.
This pull request improves the caching logic of `GetLookupDirectoryPaths` and makes it return a copy of the path collection, so the mutation happens to the returned copy, and the cached instance is kept intact. So, for every command search, the `CommandPathSearch` will resolve relative paths against the `$PWD` that the user is located at that time.
1. Create the `LocProject.json` file for PowerShell localization.
2. Remove the unused `.resx` resource files and source files.
3. Update the `ResourceValidation` tests.