Commit Graph
1261 Commits
Author SHA1 Message Date
CarloToso e8ce6a5b1f Support Unix-Socket in WebCmdlets (#19343) 2023-07-24 16:44:32 -07:00
MartinGC94 3f128d680f Change how relative paths in Resolve-Path are handled when using the RelativeBasePath parameter (#19755) 2023-07-24 09:47:24 -07:00
dwtaber 3b9e70cfc8 Wait-Process: add -Any and -PassThru parameters (#19423) 2023-07-24 09:46:16 -07:00
Armaan Mcleod 836c0c580b Added -CaseInsensitive switch parameter to Select-Object & Get-Unique cmdlets (#19683)
* Added Select-Object CaseInsensitive parameter and tests

* Added Get-Unique CaseInsensitive parameter and tests

* Fix codefactor issue

* Add named arguements

* Remove comments
2023-07-24 09:34:42 -07:00
Sean Wheeler 5595072568 Change docs.microsoft.com to learn.microsoft.com (#19994) 2023-07-17 15:54:17 -07:00
Steve Lee 5a6c66be13 Restore-Computer and Stop-Computer should fail with error when not running via sudo on Unix (#19824) 2023-07-17 14:20:06 -07:00
Armaan Mcleod d24285f437 Remove input text from the error message resulted by SecureString and PSCredential conversion failure (#19977) 2023-07-17 10:30:10 -07:00
James Truher [MSFT] ee13bb9f05 Add more debugging to try to determine why these test fail in release build. (#19829) 2023-07-05 07:40:30 -07:00
CarloToso cb2848c19b Code cleanup for Get-Content to make -Head and -Tail disallow negative values (#19715) 2023-06-21 09:35:18 -07:00
MartinGC94 15213d8494 Do not require activity when creating a completed progress record (#18474) 2023-06-19 16:20:08 -07:00
stevenebutler d614858550 WebCmdlets: Rename -TimeoutSec to -ConnectionTimeoutSeconds (with alias) and add -OperationTimeoutSeconds (#19558) 2023-06-19 15:07:16 -07:00
James Truher [MSFT] 133acc1961 Fix logic for Import-CliXml test (#19805) 2023-06-19 10:26:38 -07:00
alerickson c43beccaa2 Add reference to PSResourceGet (#19597) 2023-06-16 16:16:34 -07:00
James Truher [MSFT] ba0de3b4fe Add some debugging to the transcript test for SilentlyContinue (#19770) 2023-06-12 17:03:53 -07:00
CarloToso 1822ad7373 Add FileNameStar to MultipartFileContent in WebCmdlets (#19467) 2023-06-12 09:55:32 -07:00
James Truher [MSFT] 22fdbbda0b Re-enable Get-ComputerInfo pending tests (#19746) 2023-06-05 16:36:59 -07:00
MartinGC94 2e2b7db092 Fix wildcard globing in root of device paths (#19442) 2023-05-15 10:15:05 -07:00
Steve Lee 7888196b87 Add specific error message that creating Junctions requires absolute path (#19409) 2023-05-09 08:37:28 -07:00
xtqqczze d314b0b1c0 Fix incorrect test cases in ExecutionPolicy.Tests.ps1 (#19485) 2023-05-09 00:12:07 +00: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
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 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
Olivia 05fbceb48c Fix New-Item to re-create Junction when -Force is specified (#18311) 2023-05-02 09:36:33 -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
Aditya Patwardhan cf6fc53c9f Fix test failures on Windows for time zone and remoting (#19466) 2023-04-25 11:06:34 -07:00
stevenebutler 319c9faf57 Improve reliability of the Ctrl+c tests for WebCmdlets (#19532) 2023-04-20 09:40:01 -07:00
Dongbo Wang 8ed8b52700 Fix a race condition in Add-Type (#19471) 2023-04-12 21:41:43 -07:00
CarloToso 3dd943d212 Detect insecure https-to-http redirect only if both URIs are absolute (#19468) 2023-04-12 00:56:24 +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
Aditya Patwardhan 5a22587792 Skip VT100 tests on Windows Server 2012R2 as console does not support it (#19413) 2023-03-27 17:36:41 -07:00
James Truher [MSFT] 7ee22063c5 Improve package management acceptance tests by not going to the gallery (#19412) 2023-03-27 14:54:53 -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
MartinGC94 48c9d68356 Add the parameter -RelativeBasePath to Resolve-Path (#19358) 2023-03-22 16:44:48 -07:00
CarloToso 5b1dedac61 Allow using a folder path in WebCmdlet's OutFile parameter (#19007) 2023-03-21 13:06:50 +05:00
Aditya Patwardhan e95f7fb50f Test fixes for stabilizing tests (#19068) 2023-03-13 15:40:27 -07:00
CarloToso 9a2d2afb64 Make -Encoding parameter able to take ANSI encoding in PowerShell (#19298) 2023-03-13 15:05:28 -07:00
stevenebutler 9e341148f4 Support HTTP persistent connections in Web Cmdlets (#19249) 2023-03-07 09:42:08 -08:00
CarloToso 6824d489bb Fix using xml -Body in webcmdlets without an encoding (#19281) 2023-03-07 09:35:36 +05:00
CarloToso 8b9544b614 Adjust PUT method behavior to POST one for default content type in WebCmdlets (#19152) 2023-03-02 23:35:31 +05:00
CarloToso f1ab653d29 Preserve WebSession.MaximumRedirection from changes (#19190) 2023-03-02 00:04:20 +05:00
CarloToso cf622f869f Take into account ContentType from Headers in WebCmdlets (#19227) 2023-03-01 22:56:05 +05:00
Armaan Mcleod 0be3eeac38 Add -Path and -LiteralPath parameters to Test-Json cmdlet (#19042) 2023-02-21 10:14:08 -08:00
CarloToso 60b4e9704f Allow to preserve the original HTTP method by adding -PreserveHttpMethodOnRedirect to Web cmdlets (#18894) 2023-02-14 08:40:42 -08:00
CarloToso 69a4d79400 Webcmdlets display an error on https to http redirect (#18595) 2023-02-14 08:32:48 +05:00
CarloToso 2f43013df3 Build the relative URI for links from the response in Invoke-WebRequest (#19092) 2023-02-10 21:50:01 +05:00
CarloToso ed68c861d4 Fix redirection for -CustomMethod "POST" in WebCmdlets (#19111) 2023-02-10 16:14:29 +05:00
CarloToso 359f5c35f1 Improve Invoke-WebRequest xml and json errors format (#18837) 2023-02-09 13:22:04 +05:00
Armaan Mcleod b7e2913f6f Add -NoHeader parameter to ConvertTo-Csv and Export-Csv cmdlets (#19108) 2023-02-08 17:48:04 +05:00
CarloToso dd406b512a Add ValidateNotNullOrEmpty to OutFile and InFile parameters of WebCmdlets (#19044) 2023-02-01 21:45:09 +05:00