Commit Graph
626 Commits
Author SHA1 Message Date
yotsuda e741cecab3 Respect -Shuffle:$false in Get-SecureRandom (#26460) 2025-11-17 11:45:14 +05:00
yotsuda 77f1d99568 Respect -Shuffle:$false in Get-Random (#26457) 2025-11-17 08:36:48 +05:00
Dongbo Wang 943257b247 Make some experimental features stable (#26348)
The following experimental features are made stable:
- PSNativeWindowsTildeExpansion
- PSRedirectToVariable
- PSSubsystemPluginModel
2025-10-30 14:26:03 -07:00
xtqqczze 82d59136b2 Use [initialsessionstate] type accelerator (#25912) 2025-10-24 04:54:03 +00:00
ThioJoeandTravis Plunk 1b3a3215d2 Fix a few simple typos in comments and string outputs (#25805)
Co-authored-by: Travis Plunk <travis.plunk@microsoft.com>
2025-10-23 09:09:26 +05:00
mikkas456 123b450443 Handle null reference exception in CsvCommands.cs: ConvertPSObjectToCSV (#26144) 2025-10-16 10:09:49 +05:00
Ryan Yates 47e38beda5 Properly Expand Aliases to their actual ResolvedCommand (#25763) 2025-10-15 21:31:04 +05:00
Jonathan Gilbert e562d3f39a Correct handling of explicit -Since:$false parameter value in Get-Uptime (#26141) 2025-10-09 10:48:52 +00:00
Jordan Borean 0ef738b36f Add property and event for debug attach (#25788)
Adds the `IsRemoteDebuggerAttached` property to `Runspace` that
indicates whether a debugger is attached to the Runspace through the
`Debug-Runspace` cmdlet. Also adds a new engine event
`PowerShell.OnDebugAttach` that is emitted when the debugger is
attached.
2025-10-07 18:34:15 -04:00
Jonathan Gilbert b5279a25a1 Correct handling of explicit -Empty:$false parameter value in New-Guid (#26140) 2025-10-06 09:48:42 +05:00
Matěj KafkaandDongbo Wang 551a0fe642 Fix ConvertFrom-Json to ignore comments inside array literals (#14553) (#26050)
Co-authored-by: Dongbo Wang <dongbow@microsoft.com>
2025-09-23 10:29:11 -07:00
Dongbo Wang 506869c157 Fix -Debug to not trigger the ShouldProcess prompt (#26081) 2025-09-23 09:19:39 +05:00
Patrick Meinecke c5f2446e69 Suppress false positive PSScriptAnalyzer warnings in tests and build scripts (#25864) 2025-08-19 11:51:38 +05:00
Jordan Borean c6329ddd54 Add MethodInvocation trace for overload tracing (#21320) 2025-07-14 15:42:14 -07:00
Justin Grote 8185a7f23e Improve verbose and debug logging level messaging in web cmdlets (#25510) 2025-06-11 09:50:26 +05:00
Matěj Kafka 9071eac574 Stringify ErrorRecord with empty exception message to empty string (#24949) 2025-02-10 11:43:10 +05:00
Brendan Burns 90b0149805 Fix a bug in how Write-Host handles XmlNode object (#24669) 2024-12-13 10:24:02 -08:00
Jordan Borean 3e3d83cfa4 Treat large Enum values as numbers in ConvertTo-Json (#20999) 2024-09-19 17:24:20 +00:00
Steve Lee 9ceae0c544 Add support to Get-Error to handle BoundParameters (#20640)
* Add support to `Get-Error` to handle BoundParameters

* sort the keys

* change to generalize for all dictionaries

* address Patrick's comment to generalize and use one codepath for dictionaries

* address codefactor
2024-08-26 19:25:16 -04:00
Justin Chung 13e9aac36f Fix Invoke-RestMethod to allow -PassThru and -Outfile work together (#24086) 2024-08-05 12:23:47 -07:00
Armaan Mcleod b39b5f4252 Add ConvertTo-CliXml and ConvertFrom-CliXml cmdlets (#21063) 2024-07-26 22:12:44 +05:00
Justin Chung 9995125454 Add OutFile property in WebResponseObject (#24047) 2024-07-23 21:04:20 +00:00
CarloToso 86a7262a71 Fix WebCmdlets when -Body is specified but ContentType is not (#23952) 2024-07-01 15:35:23 -07:00
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