Commit Graph
2639 Commits
Author SHA1 Message Date
xtqqczze 2786fceb3a Fix IDE0083: UseNotPattern (#26213) 2025-10-17 11:06:45 -07:00
xtqqczze 135bb54090 Fix IDE0049 for string in System.Management.Automation (#25921) 2025-10-17 18:31:10 +05:00
xtqqczze 907c3b1f62 Fix IDE0049 for object in System.Management.Automation. Part 1 (#25923) 2025-10-17 15:30:27 +05:00
xtqqczze b4f42a07e0 Replace stackallocs with collection expressions (#25803) 2025-10-17 04:38:05 +00:00
Elvin Aslanov b46e0709fb Capitalize Windows in PSNativeWindowsTildeExpansion experimental feature description (#25266) 2025-10-16 16:29:11 +05:00
Nagy-Egri Máté Ferenc 9461d96d55 Dynamically evaluate width of LastWriteTime for formatting output on Unix (#24624) 2025-10-16 13:29:49 +05:00
xtqqczze a10ff105c9 Fix SA1028: Code should not contain trailing whitespace. Part 1. (#26203) 2025-10-16 12:58:28 +05:00
xtqqczze 250144e92d Fix IDE0083: UseNotPattern (#26209) 2025-10-16 05:24:06 +00:00
Amrit Anand b77c80ec2f Replace custom method with File.ReadAllText() in ScriptAnalysis.cs (#26060) 2025-10-15 16:36:24 +00:00
Ryan Yates 47e38beda5 Properly Expand Aliases to their actual ResolvedCommand (#25763) 2025-10-15 21:31:04 +05:00
Jorge Suarez 26bb188c8b Improve ValidateLength error message consistency and refactor validation tests (#25806) 2025-10-13 11:55:20 +05:00
xtqqczze 659c73ffd3 Avoid possible multiple enumerations in ImportModuleCommand.IsPs1xmlFileHelper_IsPresentInEntries (#26104) 2025-10-12 15:57:10 +05:00
xtqqczze db77d2ede5 Enable CA1860: Avoid using 'Enumerable.Any()' extension method (#26109) 2025-10-08 09:10:48 +05:00
xtqqczze 5cdafbc4c7 Enable CA1858: Use 'StartsWith' instead of 'IndexOf' (#26107) 2025-10-08 08:22:54 +05: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
xtqqczze 60d4bc39bc Fix memory leak in GetFileShares (#25896) 2025-10-07 14:28:19 +05:00
Anam Navied be0542b193 Add CodeQL suppresion for NativeCommandProcessor (#26145) 2025-10-03 21:48:30 +00:00
Anam Navied d5267d2ee6 Add CodeQL suppressions for UpdatableHelp and NativeCommandProcessor methods (#26132) 2025-10-01 15:52:12 -07:00
Dongbo Wang b85237876d Remove the use of Windows PowerShell ETW provider id and update PSDiagnostics module to work for PowerShell 7 (#25590) 2025-10-01 12:38:19 -07:00
Dongbo Wang 859431e002 Allow opt-out of the named-pipe listener using the environment variable POWERSHELL_DIAGNOSTICS_OPTOUT (#26086) 2025-09-30 12:56:54 -07:00
Dongbo Wang 506869c157 Fix -Debug to not trigger the ShouldProcess prompt (#26081) 2025-09-23 09:19:39 +05:00
xtqqczze 5e62bb7fa9 Remove unused FileStreamBackReader.NativeMethods type (#26062) 2025-09-22 17:22:09 -07:00
PowerShell Team Bot f08e75899c Update outdated package references (#26069) 2025-09-22 16:52:58 -07:00
Travis Plunk 2376e28482 Ensure that socket timeouts are set only during the token validation (#26066)
The main goal is to ensure that socket timeouts are set only during the token validation phase and are properly reset afterward, improving reliability and preventing unintended blocking or premature timeouts in subsequent operations.
2025-09-22 10:56:19 -07:00
Travis Plunk 42e86f6c5f Fix race condition in RemoteHyperVSocket (#26057) 2025-09-15 11:37:04 -07:00
Dongbo Wang abb70228cb Update version for the package Microsoft.PowerShell.Native (#26041) 2025-09-11 11:29:46 -07:00
PowerShell Team BotandDongbo Wang a1b417691f Move PowerShell build to use .NET SDK 10.0.100-rc.1 (#26027)
Co-authored-by: Dongbo Wang <dongbow@microsoft.com>
2025-09-10 14:55:07 -07:00
xtqqczze 43c2d98349 Remove unnecessary CS0618 suppressions from Variant APIs (#26006) 2025-09-07 14:44:14 +00:00
Anam Navied 1e46d89c63 Add Codeql Suppressions (#25943) 2025-09-03 11:14:44 -07:00
xtqqczze e2b2d1ea59 Ensure .cs files end with exactly one newline (#25968) 2025-09-03 14:09:34 +00:00
xtqqczze 7ef03a14ae Remove obsolete CA2105 rule suppression (#25938) 2025-09-03 03:45:41 +00:00
xtqqczze 44d366adb2 Remove obsolete CA1703 rule suppression (#25955) 2025-09-02 03:31:08 +00:00
xtqqczze 06ff422d2a Remove obsolete CA2240 rule suppression (#25957) 2025-09-02 03:26:45 +00:00
xtqqczze 3b6f267e19 Remove obsolete CA2233 rule suppression (#25951) 2025-09-01 03:56:16 +00:00
xtqqczze eda56e282e Remove obsolete CA1026 rule suppression (#25934) 2025-08-31 23:20:07 +05:00
Dongbo Wang 53805fb426 Add the parameter Register-ArgumentCompleter -NativeFallback to support registering a cover-all completer for native commands (#25230) 2025-08-29 15:50:02 -07:00
xtqqczze 8d524adf7f Remove obsolete CA2118 rule suppression (#25924) 2025-08-29 10:57:40 +05:00
xtqqczze cf2d7021ab Remove redundant System.Runtime.Versioning attributes (#25926) 2025-08-28 05:54:18 +00:00
Dongbo Wang 44e34f0044 Change the default feedback provider timeout from 300ms to 1000ms (#25910) 2025-08-26 16:06:23 -07:00
PowerShell Team Bot 2fb12a31f3 Update PowerShell to use .NET SDK v10-preview.7 (#25876) 2025-08-20 14:38:09 -07: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
Dongbo Wang f4a452ea3c Update PSRP protocol to deprecate session key exchange between newer client and server (#25774) 2025-08-06 22:54:11 +00:00
PowerShell Team Bot 5de50164c9 Update to .NET 10 Preview 6 (#25828) 2025-08-06 22:28:13 +00:00
Jordan Borean 8dd0d2acf8 Fix the ssh PATH check in SSHConnectionInfo when the default Runspace is not available (#25780) 2025-08-04 16:37:45 -07:00
Steve Lee 65b899c3a9 Fix Write-Host to respect OutputRendering = PlainText (#21188) 2025-08-04 16:31:59 -07:00
Jordan Borean 4415386172 Improve the $using expression support in Invoke-Command (#24025)
Always use the v5.1 `$using:` logic when dealing with any connection type that is not based on the `WSManConnectionInfo`. This allows the caller to use the more advanced `$using` features like variables with special names, having `$using` vars inside sub scopes, and more. `WSMan` based connections might still communicate with older versions but as the oldest supported version is v3 on Server 2012. We don't need to keep the default as v2 (which has been deprecated) to support some of the newer features.
2025-08-04 16:31:30 -07:00
Stéphane BARIZIEN a993992298 Adding hex format for native command exit codes (#21067) 2025-07-31 08:23:20 +05:00
Jordan Borean 11eeae97f0 Use parameter HelpMessage for tool tip in parameter completion (#25108)
Use the help message on the parameter in the completion tool tip to provide better completion help. This can be utilized by other tools to provide more context for a parameter outside of the current type and parameter name which is quite minimal.
2025-07-30 12:05:13 -07:00
Dongbo Wang b801027560 Revert "Never load a module targeting the PSReadLine module's SessionState" (#25792)
The change causes nested modules of PSReadLine to be loaded to global session state as well.

It's possible to check if we are currently importing the PSReadLine module but the check would depend on the current design of the PSReadLine module, such as how many nested modules it has, its module type, and etc., which is fragile. It's safer to just revert the change.
2025-07-29 14:32:21 -07:00
Jordan BoreanandPatrick Meinecke ce76ae1def Fix debug tracing error with magic extents (#25726)
Co-authored-by: Patrick Meinecke <SeeminglyScience@users.noreply.github.com>
2025-07-15 13:42:09 -04:00