Since DCOM is not supported in corefx there was a great deal of dead code in the computer cmdlets.
This PR removes all vestiges of DCOM support from:
- Rename-Computer
- Restart-Computer
- Stop-Computer
removing about 4500 lines of dead code. Also, tests are updated to provide more complete coverage.
I also removed test-connection completely to make way for @iSazonov upcoming PR to improve coverage in tests, I created some test hook code which will test the cmdlet code without actually calling the WMI method to restart/rename/stop the system
* fix sparse-checkout list
* Run powershell.exe in OpenCover since it will be in the path.
* If there's an error in Start-CodeCoverageRun be sure to log as much as possible
* Make the directory removal code common
* Remove AllScope from most default aliases
To speed up scope creation, I removed AllScope from most default
aliases.
This results in a 15-20% speedup for:
function foo {}
for ($i = 0; $i -lt 100kb; $i++) { & { foo } }
I left AllScope of a few frequently used aliases because it does
make command lookup faster. If we introduce something like dynamic
sites for command lookup, then we could probably remove the rest
of the AllScope aliases.
This is a low-risk breaking change. One can ask for aliases at
a particular scope:
Get-Alias -Scope 1 nsn
This could now fail if the scope number doesn't correspond to global
scope.
Address #3623.
Implementation symmetric to traditional code path that returns a PSCustomObject. Code is shared on the top level but 2 low level methods were difficult to share, therefore 2 separate but similar methods were created for HashTables.
All existing tests related to this change were adapted to also test against this new switch and were slightly improved.
-AsHashtable is an existing pattern used in Group-Object
Added the following to the Get-Service command:
•BinaryPathName (Was suggested as ServicePath )
•Description
•UserName (Was suggested as LogOnAs )
•DelayedAutoStart
•ServiceStartupType
The ServiceStartupType was also added, providing the user access to use services like in services.msc , having Automatic , Automatic (Delayed Start) , Manual and Disabled as options (Also includes InvalidValue as an initial value for ServiceStartupType )
This unifies file encoding across the inbox cmdlets to be UTF-8 without a BOM for all platforms. This is a breaking change as cmdlets on windows have a number of different encodings. This supports better interoperability with tradition Linux shells as we are using the same encoding.
Validate that files are created with UTF-8 encoding without BOM
Update tests to validate Encoding parameter to new type and create new tests for
parameter type validation.
[Breaking Change] The '-Encoding Byte' has been removed from the filesystem provider cmdlets. A new parameter '-AsByteStream' is now added to indicate that a byte stream is required as input, or output will be a stream of bytes.
* Add depth to ProcessPathItems
* Honors capped recursion when using Include or Exclude filters with Get-ChildItem
* Including test cases to test include/exclude recursion
* Swap optional parameter for overload
Updated fwlinks to pull new help content for PSv6.
Fwlink for Microsoft.PowerShell.Core module is not updated since about_*help.txt is not available yet.
•Sets -NoTypeInformation as the default behavior for Export-Csv and ConvertTo-Csv
•Hides the -NoTypeInformation parameter switch
•Adds -IncludeTypeInformation switch to Export-Csv and ConvertTo-Csv to enable legacy behavior
•Provides a terminating error when both -NoTypeInformation and -IncludeTypeInformation are supplied
•adds tests for the new behavior
•fixes existing tests to align with new behavior
The new behavior will need to be documented.
Unwrapping of 'ValueFromRemainingArguments' was being performed only for 'object[]' arrays (which covers the most common PowerShell binding scenarios) but could be skipped if a collection of any other type were passed to the parameter. This change unwraps 'ValueFromRemainingArguments' if the single element is a collection.
- Exclude 'Get-PSHostProcessInfo', 'Enter-PSHostProcess' and 'Exit-PSHostProcess' from Unix platforms.
- Update tests and add additional cmdlets need to be excluded
For PSCore 6, we are only supporting InitialSessionState. The RunspaceConfiguration APIs were already made internal. This PR removes all the code related to RunspaceConfiguration. This also means that some public APIs have changed. Was deciding between leaving the RunspaceConfiguration parameters and throwing Unsupported, but thought it was better to have it a compile-time error. This should simplify the code base.
Closes#4274
Adds an -Authentication parameter to Invoke-RestMethod and Invoke-WebRequest
Adds an -Token parameter to Invoke-RestMethod and Invoke-WebRequest
Adds an -AllowUnencryptedAuthentication parameter to Invoke-RestMethod and Invoke-WebRequest
Adds tests for various -Authorization uses
-Authentication Parameter has 3 options: Basic, OAuth, and Bearer
Basic requires -Credential and provides RFC-7617 Basic Authorization credentials to the remote server
OAuth and Bearer require the -Token which is a SecureString containing the bearer token to send to the remote server
If any authentication is provided for any transport scheme other than HTTPS, the request will result in an error. A user may use the -AllowUnencryptedAuthentication switch to bypass this behavior and send their secrets unencrypted at their own risk.
-Authentication does not work with -UseDefaultCredentials and will result in an error.
The existing behavior with -Credential is left untouched. When not supplying -Authentication, A user will not receive an error when using -Credential over unencrypted connections.
Code design choice is meant to accommodate more Authentication types in the future.
Documentation Needed
The 3 new parameters will need to be added to the Invoke-RestMethod and Invoke-WebRequest documentation along with examples. Syntax will need to be updated.
- Rename powershell.exe to pwsh.exe
- Fixe appveyor.psm1
- Update MSI to include 'pwsh' in path and app paths
- Revert change for hyper-v powershell direct
- Update names in packaging.psm1.
- Fix check for SxS
* Test fixes and updates to code coverage automation
* Fixed UpdatableHelpSystem tests and tab completion tests
* Fixed tab completion tests to better disambiguate root/interop namespace.
* Skip SSH test if ssh.exe is not present
* Get-Verb: add descriptions and prefixes
* Add description and alias prefix tests
* Make the new classes internal
* Convert alias prefix to static method
* Move verb descriptions to a resource file
* Shorten function name
* Shorten alias prefix function name
* Change tests to look at counts
* Add uniqueness test
* Add missing alias prefixes
* Fix name collision
* Change alias prefix for Compare
* Rename method
* Remove unnecessary string allocation
* Make tests easier to diagnose
The native command receives the arg ".\test 1" as .\test 1" as the last \" is treated as escaping the quotes. Fix is to add an extra backslash to escape the last enclosing quote.
* Skip check 'vsruntime140.dll' on Win10
* Make the precheck accurate
* Update windows installation prerequisites
* Change 'higher' to 'above'
* Address comments
* Address more comments
* Address some more comments
* [Feature] Update the installer test
* enable using filesystem from a UNC location
* [feature]
address PR feedback
* [feature]
removed changed in NavigationProviderBase and made change in FileSystemProvider where it should belong
* added variations of tests for set-location and push-location
no need to run [feature] anymore since it passed previously and the test case added is CI
* [feature]
move code to reproduce UNC path to GetParentPath()
* [feature]
fix detection of whether `-LiteralPath` was used to suppress wildcardexpansion
* [feature]
skip -literalpath test with asterisk in filename as that's not valid on Windows
* [feature]
added more variations of tests
* SetServiceCommand: Add positional parameter attribute
Added a positional parameter attribute to the InputObject parameter,
giving Set-Service behavior similar to the other *-Service cmdlets.
* Add test for positional InputObjects [Feature]
Added a test to Set-Service validating InputObjects passed positionally.
* [feature]
support folders and files with colon in name
* [feature]
only check separator in relation to colon if a colon is found
* [feature]
added comment to clarify algorithm
* added more tests