Commit Graph
4681 Commits
Author SHA1 Message Date
Dominik Kaszewski 270f8f1be7 Allow partial culture matching in Update-Help (#18037) 2023-05-09 09:46:59 -07:00
Steve Lee 7888196b87 Add specific error message that creating Junctions requires absolute path (#19409) 2023-05-09 08:37:28 -07:00
MartinGC94 1c8b58c0b4 Fix array type parsing in generic types (#19205) 2023-05-08 16:21:51 -07:00
CarloToso 0b078175da Improve the verbose message of WebCmdlets to show correct HTTP version (#19616) 2023-05-08 16:00:04 -07:00
mkht 9502931493 Fix HTTP status from 409 to 429 for WebCmdlets to get retry interval from Retry-After header. (#19622) 2023-05-08 15:57:27 -07:00
xtqqczze 19623357ad Remove minor versions from PSCompatibleVersions (#18635) 2023-05-08 12:37:42 -07:00
Greg Dennis 4b261ecdb6 Update JsonSchema.Net version to 4.1.0 (#19610) 2023-05-08 10:25:10 -07:00
Patrick Meinecke 16c6030f06 Fix the check when reading input in NativeCommandProcessor (#19614) 2023-05-04 12:00:18 -07:00
Steve Lee bfa6883f2a Add support of respecting $PSStyle.OutputRendering on the remote host (#19601) 2023-05-04 09:50:04 -07:00
Greg Dennis 1b248efb3f Test-Json: Use JsonSchema.Net (System.Text.Json) instead of NJsonSchema (Newtonsoft.Json) (#18141)
Updates the Test-Json cmdlet to use JsonSchema.Net instead of NJsonSchema in order to:

- use System.Text.Json instead of Newtonsoft
- support the latest JSON Schema drafts (up to 2020-12)
2023-05-04 08:19:32 +05:00
07e041fe10 Allow combining of -Skip and -SkipLast parameters in Select-Object cmdlet. (#18849)
* Added SkipLast parameter set to Skip parameter and updated tests

* Using Should -BeExactly with string

* Update test/powershell/Modules/Microsoft.PowerShell.Utility/Select-Object.Tests.ps1

---------

Co-authored-by: Travis Plunk <travis.plunk@microsoft.com>
Co-authored-by: Travis Plunk <github@ez13.net>
2023-05-02 13:07:32 -07:00
Steve Lee 8135167827 Fix constructing PSModulePath if a sub-path has trailing separator (#13147)
* Fix constructing PSModulePath if a sub-path has trailing separator

* skip test on Linux

* Removed test as the system env var needs to be modified to repro

* Add test

* Fix test by comparing against incorrectly created path

* Update test to be cross platform
2023-05-02 13:04:30 -07:00
Steve LeeandJames Truher [MSFT] a153446a01 Add Get-SecureRandom cmdlet (#19587)
* Add `Get-SecureRandom` cmdlet

* update comments

* address Paul and Travis' comments

* Update test/powershell/Modules/Microsoft.PowerShell.Utility/Get-SecureRandom.Tests.ps1

Co-authored-by: James Truher [MSFT] <jimtru@microsoft.com>

* address codefactor

* address Ilya's feedback creating a base class for both cmdlets

* remove unused `using`

---------

Co-authored-by: James Truher [MSFT] <jimtru@microsoft.com>
2023-05-02 10:54:39 -07:00
Ikko Eltociear Ashimine 5d7b3fc453 Fix a typo in serialization.cs (#19598) 2023-05-02 09:41:27 -07:00
Olivia 05fbceb48c Fix New-Item to re-create Junction when -Force is specified (#18311) 2023-05-02 09:36:33 -07:00
xtqqczze c77c286d7a Remove PSv2CompletionCompleter as part of the PowerShell v2 code cleanup (#18337) 2023-05-01 22:00:07 -07:00
MartinGC94 5605b24b08 Improve Hashtable key completion for type constrained variable assignments, nested Hashtables and more (#17660) 2023-05-01 16:26:41 -07:00
Dominik Kaszewski ea68edc686 Set-Clipboard -AsOSC52 (#18222)
* Set remote clipboard using OSC52

* Fix codefactor comment

* Rename parameter from Using to As

* Rename alias
2023-05-01 14:53:31 -07:00
Jack CaseyandTravis Plunk 698742ea9f Test-Connection: Increase output detail when performing a tcp test (#11452)
* Added verbose TCP test logic

* Cleaned up output, removed source IP address

* Consolidated detailed output logic into ProcessConnectionByTCPPort()

* Updated existing tests with -Quiet switch

* Improved output formatting, changed logic to match

* Error handling and logic improvements

* Updated tests to match new output

* Updated logic, tcp tests now run once by default

* Moved TcpConnectionTestResult enum into TcpTestStatus class

* Removed unnecessary whitespace

* Wrapped TcpClient() in Using statement

* Appended missing period on comments

* Change TcpTestStatus to TcpPortStatus for better clarity

* Set default count back to 4

* Move stopwatch reset into finally block

* Change TcpConnectionTestResult.New to TcpConnectionTestResult.None

* Formatting fixes

* Increase column size for Result output

* Update logic for -quiet option

* Change "TestNum" property to "Id"

* Change Destination and DestinationAddress to Target and TargetAddress in TcpPortStatus

* Implement new form of using declaration

* Fix indentation

* Update output, improve logic and update tests

* Add CancellationToken to allow cancel before timeout

* Assign testResult.Connected to client.Connected

* Move TcpPortStatus object creation to after connection test

* Remove delay from final connection test in loop

* Move Count logic from ProcessConnectionByTCPPort into own function

* Fix small formatting error

* Add handling for TaskCanceledException

* Remove redundant CancellationToken getter

* Clean up handling of SocketException

* Increase readability of final loop check

* Remove unnecessary TimeSpan invocation

* Rename cancellationTokenSource to match convention

* Move SetCountForTcpTest() into BeginProcessing()

* Added nameof to Count check

* Removed explicit type declaration for TcpClient

* Move delay and timeout evaluation out of the cycle

* Remove redundant CancellationTokenSource

* Initialize detailed SwitchParameter

* Add check for Detailed parameter

* Remove redundant tests for non-detailed output

* Add return after first boolean output

* Update tests with new detailed parameter set

---------

Co-authored-by: Travis Plunk <travis.plunk@microsoft.com>
2023-05-01 14:16:11 -07:00
xtqqczze 31bc65ef65 Refactor MUIFileSearcher.AddFiles in the help related code (#18825) 2023-05-01 11:43:04 -07:00
Aditya Patwardhan 72c81b820a Set SetLastError to true for symbolic and hard link native APIs (#19566) 2023-05-01 10:56:16 -07:00
Patrick Meinecke 2424ad83aa Support byte stream piping between native commands and file redirection (#17857) 2023-04-27 17:17:32 -07:00
Jordan Borean 93e9c63331 Fix Get-AuthenticodeSignature -Content to not roundtrip the bytes to a Unicode string and then back to bytes (#18774) 2023-04-25 12:11:04 -07:00
CarloToso 543b20b4ed Enable more nullable annotations in WebCmdlets (#19359) 2023-04-24 08:38:30 +05:00
Steve Lee 5e96ed3822 Change the arrow used in feedback suggestion to a more common Unicode character (#19534) 2023-04-18 17:15:51 -07:00
Dongbo Wang 457606af94 Support trigger registration in feedback provider (#19525) 2023-04-18 17:15:09 -07:00
PowerShell Team Bot e1b392b6ff Update .NET SDK version from 8.0.100-preview.2.23157.25 to 8.0.100-preview.3.23178.7 (#19381) 2023-04-18 15:24:51 -07:00
Travis Plunk e05a09734f Force updating the transitive dependency on Microsoft.CSharp (#19514) 2023-04-18 12:07:46 -07:00
Dongbo Wang 8ed8b52700 Fix a race condition in Add-Type (#19471) 2023-04-12 21:41:43 -07:00
Ikko Eltociear Ashimine af2f2f454e Fix typo in Compiler.cs (#19491)
inital -> initial
2023-04-12 09:51:22 +05:00
CarloToso 3dd943d212 Detect insecure https-to-http redirect only if both URIs are absolute (#19468) 2023-04-12 00:56:24 +00:00
Darren Kattan 9d036c4876 Revert "Bump Microsoft.CodeAnalysis.CSharp from 4.5.0 to 4.6.0-2.23152.6" (#19464) 2023-04-11 00:24:42 +00:00
stevenebutler 17fb783736 Support CTRL-C when reading data and connection hangs for Invoke-RestMethod and Invoke-WebRequest (#19330) 2023-04-03 23:08:35 +00:00
Steve Lee 7c0fe762a9 Remove code related to #requires -pssnapin (#19320) 2023-04-03 14:56:40 -07:00
Steve Lee 04b93af4ae Enable type conversion of AutomationNull to $null for assignment (#19415) 2023-04-03 09:36:36 -07:00
Dongbo Wang 51f55f716e Update the ICommandPredictor interface to reduce boilerplate code from predictor implementation (#19414) 2023-03-29 11:27:04 -07:00
Steve Lee 2553a56db2 Add -Environment parameter to Start-Process (#19374)
* Add `-Environment` parameter to `Start-Process`

* address codefactor

* fix test for Windows

* handle case where value is $null to remove env var

* change variables to make it more clear what the test is doing
2023-03-27 11:05:04 -07:00
CarloToso fc918bc186 Remove GetResponseObject (#19380) 2023-03-24 09:11:40 +05:00
MartinGC94 25651ef6e9 Fix a crash in the type inference code (#19400) 2023-03-23 14:40:50 -07:00
MartinGC94 48c9d68356 Add the parameter -RelativeBasePath to Resolve-Path (#19358) 2023-03-22 16:44:48 -07:00
CarloToso 098be48033 Revert "Remove FormObject.cs and FormObjectCollection.cs (#19383)" (#19387)
This reverts commit 190c99a416.
2023-03-22 22:22:29 +05:00
MartinGC94 18f0c5ad4b Exclude redundant parameter aliases from completion results (#19382) 2023-03-22 08:58:15 +05:00
CarloToso 190c99a416 Remove FormObject.cs and FormObjectCollection.cs (#19383) 2023-03-21 22:59:14 +05:00
CarloToso 5b1dedac61 Allow using a folder path in WebCmdlet's OutFile parameter (#19007) 2023-03-21 13:06:50 +05:00
CarloToso 8f0cd65257 Simplify ContentHelper methods (#19367) 2023-03-20 21:14:49 +05:00
CarloToso 688c7f3689 Initialize Regex lazy in BasicHtmlWebResponseObject (#19361) 2023-03-18 22:06:32 +05:00
CarloToso 69e9b439fd Fix codefactor if part 5 (#19286) 2023-03-16 22:02:42 +05:00
CarloToso e5690cb176 Add nullable annotations in WebRequestSession.cs (#19291) 2023-03-16 17:33:29 +05:00
MartinGC94 8b964ded36 Speed up Resolve-Path relative path resolution (#19171) 2023-03-15 08:12:09 +05:00
MartinGC94 39d48f9c62 Infer external application output as strings (#19193) 2023-03-14 11:24:43 -07:00