Commit Graph
603 Commits
Author SHA1 Message Date
Armaan Mcleod ec3840d6a1 Add IgnoreComments and AllowTrailingCommas options to Test-Json cmdlet (#23817) 2024-06-24 13:03:22 +05:00
167a492415 Redirecting to a variable should be possible (#20381)
* add tests

* fix formatting issues

* Make redirection to variable an experimental feature.

Update test to check for experimental feature status.
Set-Variable will still have the -append parameter, but if used when the experimental feature is disabled, a parameter binding error will result.

* Check to be sure provider is not null.

* update to use different FullyQualifiedErrorId

* use Experimental attribute for append parameter rather than runtime check.

* Revert "update to use different FullyQualifiedErrorId"

This reverts commit 8b34af1ac19ecdb821b34534e446ab129830c92f.

* Update src/Microsoft.PowerShell.Commands.Utility/commands/utility/Var.cs

Co-authored-by: Ilya <darpa@yandex.ru>

* Move remediation steps into resource.

Update Set-Variable -Append to be correct when -name and -value are used.
Add tests for the new behavior in Set-Variable.

* Change expected error for contrained language mode and redirection.

* Update src/Microsoft.PowerShell.Commands.Utility/commands/utility/Var.cs

Co-authored-by: Ilya <darpa@yandex.ru>

* Support redirection of native app.

Add tests to validate.

* testexe needs proper case to run on linux.

* Address codefactor issues 01.

* Update src/System.Management.Automation/engine/runtime/Operations/MiscOps.cs

Co-authored-by: Steve Lee <slee@microsoft.com>

* Update src/Microsoft.PowerShell.Commands.Utility/commands/utility/Var.cs

Co-authored-by: Steve Lee <slee@microsoft.com>

* Update src/System.Management.Automation/engine/runtime/Operations/MiscOps.cs

Co-authored-by: Steve Lee <slee@microsoft.com>

---------

Co-authored-by: Ilya <darpa@yandex.ru>
Co-authored-by: Steve Lee <slee@microsoft.com>
2024-06-11 12:42:04 -04:00
Jordan Borean fcf4953c3b ConvertTo-Json: Serialize BigInteger as a number (#21000) 2024-02-27 14:52:58 -08:00
Steve Lee 05ed2f270c Revert "Adjust PUT method behavior to POST one for default content type in WebCmdlets" (#21049) 2024-02-26 11:51:12 -08:00
Steve Lee a880377d8a Fix a regression in Format-Table when header label is empty (#21156) 2024-02-26 11:44:30 -08:00
Jordan Borean 71035543e7 ConvertFrom-Json: Add -DateKind parameter (#20925)
Adds the -DateKind parameter to the ConvertFrom-Json that allows the
caller to control how DateTime strings are converted into an object. The
default behaviour is to create a DateTime value with the Kind being
Unspecified if no TZ is set, Utc if the TZ Z is set, Local (after
conversion) if an explicit TZ is set. This adds a Utc, Local to
explicitly set the Kind as desired as well as a Offset and String value
to create a DateTimeOffset or keep as a string.
2024-02-13 09:05:07 +05:00
Matthias Wolf ac84c35820 Fix regression in #20608. (#20745) 2023-11-30 10:13:06 +05:00
Patrick Meinecke d3c91d0e63 Added a missing ConfigureAwait(false) call (#20606) 2023-11-01 12:42:28 -07:00
CarloToso 344ac7b08a New-Guid add -Empty and -InputObject parameters (#20014) 2023-08-28 09:33:55 -07:00
James Truher [MSFT] 046301b716 Additional test hardening for tests which fail in release pass. (#20093) 2023-08-16 11:28:59 -07:00
James Truher [MSFT] 91447e62de Fixes for release tests (#20028) 2023-07-27 15:04:30 -07:00
CarloToso e8ce6a5b1f Support Unix-Socket in WebCmdlets (#19343) 2023-07-24 16:44:32 -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
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
CarloToso 1822ad7373 Add FileNameStar to MultipartFileContent in WebCmdlets (#19467) 2023-06-12 09:55:32 -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
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
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
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
Travis PlunkandAditya Patwardhan b2c4888ebb Add Windows ARM64 CI (#19040)
* Add CI for win-arm64

* Add common function to test for windows arm64

* Update because string where items need investigation

---------

Co-authored-by: Aditya Patwardhan <adityap@microsoft.com>
2023-01-31 12:06:29 -08:00
CarloToso 282fc5fc08 Fix bug with managing redirection and keepAuthorization in Web cmdlets (#18902) 2023-01-13 18:31:03 +05:00
Steve Lee 2baeb1a7f0 Fix Get-Error to work with strict mode (#18895) 2023-01-13 18:00:20 +05:00
CarloToso f018beedff Add tests for Allowinsecureredirect parameter in Web cmdlets (#18939) 2023-01-13 17:37:55 +05:00
CarloToso 465165fd97 Invoke-RestMethod -FollowRelLink fix links containing commas (#18829) 2023-01-11 21:39:04 +05:00
CarloToso 31af38c22a Create test to check if WebCmdlets decompress brotli-encoded data (#18905) 2023-01-10 08:07:00 +05:00
Steve Lee f04940b76c Fix Format-Table -RepeatHeader for property derived tables (#18870) 2022-12-31 12:00:00 +05:00