Commit Graph
367 Commits
Author SHA1 Message Date
Dongbo Wang 78e437c6f3 Fix the PSNativeCommandArgumentPassing test (#27057) 2026-03-18 15:32:15 -07:00
Dongbo Wang c19a440244 Fix Import-Module.Tests.ps1 to handle Arm32 platform (#26862) 2026-02-20 14:05:55 -08:00
Yoshifumi 5c57c3e19c Fix NOTES section formatting in comment-based help (#26512) 2025-12-03 08:35:44 +00: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
Dongbo Wang d68c15e743 Update PATH environment variable for package manager executable on Windows (#25847)
Implementation for PowerShell/PowerShell-RFC#391. A few implementation decisions:

1. Check the package manager list only once per process (**same as CMD**). So, changing the package manager list in registry doesn't affect a PowerShell session that is already running.

2. When detecting user/system PATH value changes, only check new items PREPENDED or APPENDED to the original string (**same as CMD**). The detection is made simple, which is not intended to detect complex changes to the user/system PATH.

3. The PATH update feature is disabled when the `Environment` provider is not available, or when the current session is restricted.
    - Both `Environment` provider and `IsSessionRestricted` are checked only once per PowerShell session.
    - Use `ConditionalWeakTable` to cache whether the feature is enabled or not for a given session.
    - We cannot use `thread-static` variable for the caching because it's possible for Runspace to reuse threads.
2025-08-20 12:53:59 -07:00
CMandDongbo Wang b502098e3a Fix the common parameter -ProgressAction for advanced functions (#24591)
Co-authored-by: Dongbo Wang <dongbow@microsoft.com>
2025-06-03 09:43:38 -07:00
Matthias Wolf eb1cc6ddcd Make inherited protected internal instance members accessible in PowerShell class scope (#25245) 2025-05-12 14:30:12 -07:00
Armaan Mcleod e308222e19 Fix WildcardPattern.Escape to escape lone backticks correctly (#25211) 2025-03-25 09:05:42 +05:00
Jordan Borean 93e053c57e Add PipelineStopToken to Cmdlet which will be signaled when the pipeline is stopping (#24620) 2025-03-24 14:36:05 -07:00
Dongbo Wang ef64132f0a Fix TypeName.GetReflectionType() to work when the TypeName instance represents a generic type definition within a GenericTypeName (#24985) 2025-03-17 15:40:25 -07:00
Justin ChungandJustin Chung a69452ebeb Update metadata.json (#24764)
* Updated metadata.json

* Added 7.6 to version checks

---------

Co-authored-by: Justin Chung <chungjustin@microsoft.com>
2025-01-14 12:42:18 -06:00
Jordan Borean 294adb47f1 Add support for interface static abstract props
Add support for writing a PowerShell class that can implement an
interface that contains a static abstract property introduced in C# 11.
2024-12-10 14:02:11 -05:00
Dongbo Wang dcf6754445 Fix the extent of the parser error when a number constant is invalid (#24024) 2024-07-09 10:55:25 -07: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
Dongbo Wang d564d0fff9 Bump to .NET 9 preview 3 (#21782) 2024-05-09 15:36:52 -07:00
Dongbo Wang 171d9dfa71 Revert the PR #17856 (Do not preserve temporary results when no need to do so) (#21368) 2024-03-25 14:09:11 -07:00
Patrick Meinecke 4faf52726d Make sure both stdout and stderr can be redirected from a native executable (#20997) 2024-03-14 11:42:30 -07:00
Dongbo Wang 4e357f129e Fix PowerShell class to support deriving from an abstract class with abstract properties (#21331) 2024-03-13 14:44:57 -07:00
Aditya Patwardhan 8921a7dcad Skip test on Windows Server 2012 R2 for no-nl (#21265) 2024-02-22 16:26:30 -08:00
Dom Slee c56a52b8c0 Add tilde expansion for windows native executables (#20402) 2024-02-12 09:58:27 -08:00
James Truher [MSFT] e9682c151d Fix using assembly to use Path.Combine when constructing assembly paths (#21169) 2024-02-01 09:49:20 -08:00
Dongbo Wang 783fb46e65 Validate the value for using namespace during semantic checks to prevent declaring invalid namespaces (#21162) 2024-02-01 09:42:37 -08:00
Chris Dent 5282c9bb91 Add Import-LocalizedData implicit Localization fallback (#19896)
* Adds culture fallback to Import-LocalizedData

* Only add fallback if current culture is not en-US

* Pester 4 compatibility

* Missing param block in It

* Missed param block for It

* Skip UICulture name test for Linux and Mac

* Removed test fragment
2024-01-04 13:42:41 -05:00
Aditya Patwardhan 094e22e97d Update README and metadata.json for upcoming releases (#20696) 2023-11-16 10:04:58 -08:00
Armaan Mcleod 2a7384cc71 Include Module Version in error messages when module is not found (#20144) 2023-09-12 21:59:29 +05:00
James Truher [MSFT] 046301b716 Additional test hardening for tests which fail in release pass. (#20093) 2023-08-16 11:28:59 -07:00
Frode Flaten ced79cd1a1 Use OrdinalIgnoreCase to lookup script breakpoints (#20046) 2023-07-31 17:45:49 -07:00
James Truher [MSFT] 5437f387cc Add a new experimental feature to control native argument passing style on Windows (#18706) 2023-06-19 16:31:56 -07:00
James Truher [MSFT] b9b5136f0e Avoid checking screen scraping on non-Windows platforms before launching native app (#19812) 2023-06-19 11:26:14 -07:00
MartinGC94 6520c05949 Fix parsing for array literals in index expressions in method calls (#19224) 2023-06-05 14:10:03 -07:00
MartinGC94 31dd6483b2 Fix incorrect string to type conversion (#19560)
Fixes incorrect string to type conversions like: [Type] 'int]whatever' so they are no longer parsed as types.
This was fixed by adding a check for ScanType to also check that the parsed type name matches the input type name.
2023-05-31 09:39:38 +05:00
MartinGC94 1c8b58c0b4 Fix array type parsing in generic types (#19205) 2023-05-08 16:21:51 -07:00
Aditya Patwardhan cf6fc53c9f Fix test failures on Windows for time zone and remoting (#19466) 2023-04-25 11:06:34 -07:00
Steve Lee 04b93af4ae Enable type conversion of AutomationNull to $null for assignment (#19415) 2023-04-03 09:36:36 -07: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
MartinGC94 799eed8f57 Update and enable the test for the type of $input (#18968) 2023-03-13 16:17:28 -07: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
Mathias R. Jessen 1925cf67af Add Statement property to $MyInvocation (#19027) 2023-03-06 15:01:42 -08:00
Dongbo Wang ef0af95845 Make the exception error in PowerShell able to associate with the right history entry (#19095) 2023-02-08 10:18:32 -08: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
Steve Lee 27b5a0632d Add -ProgressAction common parameter (#18887) 2023-01-09 09:40:40 -08:00
Aditya Patwardhan 2b38f80855 Update the release tag in metadata.json for next preview (#18799) 2022-12-15 10:43:55 -08:00
Dongbo Wang 061947969d Allow non-default encodings to be used in user's script/code (#18605) 2022-12-07 10:16:06 +05:00
James Truher [MSFT] 074aad6ea9 Add missing -Tag 'CI' to describe blocks. (#18316) 2022-10-17 15:27:24 -07:00
Dongbo Wang 79b8140199 Make PowerShell class not affiliate with Runspace when declaring the NoRunspaceAffinity attribute (#18138) 2022-09-22 10:49:08 -07:00
Dongbo Wang 1a82574743 Treat [NullString]::Value as the string type when resolving methods (#18080) 2022-09-15 17:35:56 -07:00
Steve Lee 6744ffb826 Make experimental feature PSNativeCommandArgumentPassing stable (#18044) 2022-09-12 09:48:09 -07:00
Frode Flaten a15bfcb501 Throw when too many parameter sets are defined (#17881) 2022-08-22 12:11:17 -07:00