This PR fixes the logging issue on Linux where logging is initialized before `-settingsFile` is parsed causing custom log settings to be ignored. (see ConsoleHost.cs and ManagedEntrance.cs)
The PR also includes basic logging tests for Linux and MacOS. PSSyslog.psm1 contains the functions to retrieve selected logged items (based on PowerShell's log id and a timestamp) and Logging.Tests.ps1 contains tests for Linux and MacOS.
Fix error in windows provider when the environment has accidental duplicates that differ only by case.
Make the provider storage for the environment on windows ignore duplicates and only report the effective value.
Add tests to verify existing environment get-item behavior and to ensure that Get-Item env:<var> reports the same as $env:<var>, namely the effective value.
Fixes#6305 and supersedes #6320 based on discussion in #6460.
Fixes#5964
Adds -Resume switch to Invoke-WebRequest and Invoke-RestMethod
-Resume requires -OutFile
Enables the ability to resume downloading a partially or incompletely downloaded file.
File Size is the only indicator of local and remote file parity.
If the local file is smaller than the remote file and the remote endpoint supports resume, the local file will be appended with the remaining bytes.
If the local file is larger than the remote file, the local file will be overwritten
If the remote server does not support resume, the local file will be overwritten
If the local file is the same size as the remote file, the remote endpoint will return a 416 status code. This response is special-cased as a success in this instance. The local file remains untouched and it is assumed the file was already successfully downloaded previously.
If the local file does not exist it will be created and the entire remote file will be requested.
Added tests for all code new code paths (I'm pretty sure anyway)
Added /Resume Controller to WebListener
Documented /Resume Controller
Updated .spelling to reflect terms in WebListener docs
Note: I had to change the way GetResponse() tracks the current URI as we now have 3 places where the call is taking place. I don't foresee this causing any regressions. This area needs some refactoring. especially if we want to implement a retry mechanism
* commands: make rvpa -relative do not return ./absolute_path
This happens on Windows when $pwd and -path is on different drive
* only return relative path inside current root
1. Add a null check in the tab completion code on the binding result returned from `PseudoParameterBinder`;
2. Add a null check in `CommandDiscovery.LookupCommandProcessor` on the `CommandInfo` object returned from the method `LookupCommandInfo`.
For a PropertyOnlyAdapter, the property may come from various sources, but methods, including parameterized properties, still come from DotNetAdapter. So, the binder can optimize on method calls for objects that map to a custom PropertyOnlyAdapter.
Add support for replacement lambdas when using the -replace operator.
Requires minimal changes to existing code by using the following overload:
Regex.Replace(string input, MatchEvaluator evaluator)
when a ScriptBlock is passed in as the replacement argument.
Also remove a couple of language tests which were actually duplicated
Change the one loop which loops through test cases to include an iteration number to remove test name duplication
* Tests for Get-Process cmdlet.
* Tests for Get-Process run as admin.
* Skipping some Get-Process tests on Linux
* Skip test for -FileVersionInfo parameter for Linux because of the bug that cause the command to hang.
* Add checks for ErrorId in Get-Process tests
* Change one Get-Process test status to pending for MacOs
Some CI level 'Save-Help' tests were disabled in #2806 because HelpInfo URIs for powershell modules were broken (tracked by #2807). However, they were forgotten to be enabled when the URI issue was fixed. This PR reenables those tests.
- The original change to remove extra padding didn't take into account alignment.
Fix logic to accommodate left, center, and right alignment in the table format and also add tests.
- Fix ImplicitRemoting test that validates formatting to use same instance due to formatting changes in this PR
- Only use loopback to same powershell instance for formatting test as the other tests implicitly expect Windows PowerShell.