Edit

Share via


What's New in PowerShell 7.6

PowerShell 7.6-preview.5 includes the following features, updates, and breaking changes. PowerShell 7.6 is built on .NET 9.0.101 GA release.

For a complete list of changes, see the CHANGELOG in the GitHub repository.

Updated modules

PowerShell 7.6-preview.5 includes the following updated modules:

  • Microsoft.PowerShell.PSResourceGet v1.1.0
  • PSReadLine v2.4.4-beta4
  • Microsoft.PowerShell.ThreadJob v2.2.0
  • ThreadJob v2.1.0

The ThreadJob was renamed to Microsoft.PowerShell.ThreadJob module. There is no difference in the functionality of the module. To ensure backward compatibility for scripts that use the old name, the ThreadJob v2.1.0 module is a proxy module that points to the Microsoft.PowerShell.ThreadJob v2.2.0.

Breaking Changes

  • Fix WildcardPattern.Escape to escape lone backticks correctly (#25211) (Thanks @ArmaanMcleod!)
  • Convert -ChildPath parameter to string[] for Join-Path cmdlet (#24677) (Thanks @ArmaanMcleod!)
  • Remove trailing space from event source name (#24192) (Thanks @MartinGC94!)

Tab completion improvements

  • Use parameter HelpMessage for tool tip in parameter completion (#25108) (Thanks @jborean93!)
  • Remove duplicate modules from completion results (#25538) (Thanks @MartinGC94!)
  • Add completion for variables assigned in ArrayLiteralAst and ParenExpressionAst (#25303) (Thanks @MartinGC94!)
  • Fix tab completion for env/function variables (#25346) (Thanks @jborean93!)
  • Update Named and Statement block type inference to not consider AssignmentStatements and Increment/decrement operators as part of their output (#21137) (Thanks @MartinGC94!)
  • Add -PropertyType argument completer for New-ItemProperty (#21117) (Thanks @ArmaanMcleod!)
  • Add completion single/double quote support for -Noun parameter for Get-Command (#24977) (Thanks @ArmaanMcleod!)
  • Add completion single/double quote support for -PSEdition parameter for Get-Module (#24971) (Thanks @ArmaanMcleod!)
  • Convert InvalidCommandNameCharacters in AnalysisCache to SearchValues<char> for more efficient char searching (#24880) (Thanks @ArmaanMcleod!)
  • Convert s_charactersRequiringQuotes in Completion Completers to SearchValues<char> for more efficient char searching (#24879) (Thanks @ArmaanMcleod!)
  • Update IndexOfAny() calls with invalid path/filename to SearchValues<char> for more efficient char searching ([#24896][24896]) (Thanks @ArmaanMcleod!)
  • Replace char[] array in CompletionRequiresQuotes with cached SearchValues<char> (#24907) (Thanks @ArmaanMcleod!)
  • Add quote handling in Verb, StrictModeVersion, Scope and PropertyType Argument Completers with single helper method (#24839) (Thanks @ArmaanMcleod!)
  • Fix share completion with provider and spaces (#19440) (Thanks @MartinGC94!)
  • Improve variable type inference (#19830) (Thanks @MartinGC94!)
  • Add tooltips for hashtable key completions (#17864) (Thanks @MartinGC94!)
  • Fix type inference of parameters in classic functions (#25172) (Thanks @MartinGC94!)
  • Improve assignment type inference (#21143) (Thanks @MartinGC94!)
  • Exclude OutVariable assignments within the same CommandAst when inferring variables (#25224) (Thanks @MartinGC94!)
  • Fix parameter completion when script requirements fail (#17687) (Thanks @MartinGC94!)
  • Improve the completion for attribute arguments (#25129) (Thanks @MartinGC94!)
  • Fix completion that relies on pseudobinding in script blocks (#25122) (Thanks @MartinGC94!)
  • Don't complete duplicate command names (#21113) (Thanks @MartinGC94!)
  • Add completion for variables assigned by command redirection (#25104) (Thanks @MartinGC94!)
  • Fix TypeName.GetReflectionType() to work when the TypeName instance represents a generic type definition within a GenericTypeName (#24985)
  • Update variable/property assignment completion so it can fallback to type inference (#21134) (Thanks @MartinGC94!)
  • Handle type inference for redirected commands (#21131) (Thanks @MartinGC94!)
  • Use Get-Help approach to find about_*.help.txt files with correct locale for completions (#24194) (Thanks @MartinGC94!)
  • Fix completion of variables assigned inside Do loops (#25076) (Thanks @MartinGC94!)
  • Fix completion of provider paths when a path returns itself instead of its children (#24755) (Thanks @MartinGC94!)
  • Enable completion of scoped variables without specifying scope (#20340) (Thanks @MartinGC94!)
  • Fix issue with incomplete results when completing paths with wildcards in non-filesystem providers (#24757) (Thanks @MartinGC94!)

Cmdlet improvements

  • Fix Out-GridView by replacing use of obsolete BinaryFormatter with custom implementation (#25497) (Thanks @mawosoft!)
  • Improve verbose and debug logging level messaging in web cmdlets (#25510) (Thanks @JustinGrote!)
  • Improve debug logging of Web cmdlet request and response (#25479) (Thanks @JustinGrote!)
  • Add the parameter Register-ArgumentCompleter -NativeFallback to support registering a cover-all completer for native commands (#25230)
  • Treat -Target as literal in New-Item (#25186) (Thanks @GameMicrowave!)
  • Update PATH environment variable for package manager executable on Windows (#25847)
  • Update Get-Service to ignore common errors when retrieving non-critical properties for a service (#24245) (Thanks @jborean93!)
  • Add single/double quote support for Join-String Argument Completer (#25283) (Thanks @ArmaanMcleod!)
  • Remove IsScreenReaderActive() check from ConsoleHost (#26118)
  • Improve the $using expression support in Invoke-Command (#24025) (Thanks @jborean93!)
  • Change the default feedback provider timeout from 300ms to 1000ms (#25910)
  • Add support for thousands separators in [bigint] casting (#25396) (Thanks @AbishekPonmudi!)
  • Add MethodInvocation trace for overload tracing (#21320) (Thanks @jborean93!)
  • Fix ConvertFrom-Json to ignore comments inside array literals (#14553) (#26050) (Thanks @MatejKafka!)
  • Fix -Debug to not trigger the ShouldProcess prompt (#26081)
  • Fix Write-Host to respect OutputRendering = PlainText (#21188)
  • Fix debug tracing error with magic extents (#25726) (Thanks @jborean93!)
  • Fix quoting in completion if the path includes a double quote character (#25631) (Thanks @MartinGC94!)
  • Fix the common parameter -ProgressAction for advanced functions (#24591) (Thanks @cmkb3!)
  • Fix the NullReferenceException when writing progress records to console from multiple threads (#25440) (Thanks @kborowinski!)
  • Use absolute path in FileSystemProvider.CreateDirectory (#24615) (Thanks @Tadas!)
  • Make inherited protected internal instance members accessible in PowerShell class scope (#25245) (Thanks @mawosoft!)
  • Add internal methods to check Preferences (#25514) (Thanks @iSazonov!)
  • Add -ExcludeModule parameter to Get-Command (#18955) (Thanks @MartinGC94!)
  • Return correct FileName property for Get-Item when listing alternate data streams (#18019) (Thanks @kilasuit!)
  • Fix Get-ItemProperty to report non-terminating error for cast exception (#21115) (Thanks @ArmaanMcleod!)
  • Fix a bug in how q handles XmlNode object (#24669) (Thanks @brendandburns!)
  • Error when New-Item -Force is passed an invalid directory name (#24936) (Thanks @kborowinski!)
  • Allow Start-Transcript to use $Transcript which is a PSObject wrapped string to specify the transcript path (#24963) (Thanks @kborowinski!)
  • Improve Start-Process -Wait polling efficiency (#24711) (Thanks @jborean93!)
  • Add completion of modules by their shortname (#20330) (Thanks @MartinGC94!)

Engine improvements

  • Update the PSDiagnostics module to manage the PowerShellCore provider in PowerShell 7 (#25590)
  • Allow opt-out of the named-pipe listener using the environment variable POWERSHELL_DIAGNOSTICS_OPTOUT (#26086)
  • Ensure that socket timeouts are set only during the token validation (#26066)
  • Fix stderr output of console host to respect NO_COLOR (#24391)
  • Update PSRP protocol to deprecate session key exchange between newer client and server (#25774)
  • Fix the ssh PATH check in SSHConnectionInfo when the default Runspace is not available (#25780) (Thanks @jborean93!)
  • Adding hex format for native command exit codes (#21067) (Thanks @sba923!)
  • Fix infinite loop crash in variable type inference (#25696) (Thanks @MartinGC94!)
  • Add PSForEach and PSWhere as aliases for the PowerShell intrinsic methods Where and Foreach (#25511) (Thanks @powercode!)
  • Added the AIShell module to telemetry collection list (#24747)
  • Added helper in EnumSingleTypeConverter to get enum names as array (#17785) (Thanks @fflaten!)
  • Update DnsNameList for X509Certificate2 to use X509SubjectAlternativeNameExtension.EnumerateDnsNames() Method (#24714) (Thanks @ArmaanMcleod!)
  • Stringify ErrorRecord with empty exception message to empty string (#24949) (Thanks @MatejKafka!)
  • Add PipelineStopToken to Cmdlet which will be signaled when the pipeline is stopping (#24620) (Thanks @jborean93!)
  • Fallback to AppLocker after WldpCanExecuteFile (#24912)
  • Move .NET method invocation logging to after the needed type conversion is done for method arguments (#25022)
  • Fix infinite loop in variable type inference (#25206) (Thanks @MartinGC94!)
  • Remove the old fuzzy suggestion and fix the local script file name suggestion (#25177)
  • Make SystemPolicy public APIs visible but non-op on Unix platforms so that they can be included in PowerShellStandard.Library (#25051)
  • Set standard handles explicitly when starting a process with -NoNewWindow (#25061)
  • Fix tooltip for variable expansion and include desc (#25112) (Thanks @jborean93!)
  • Use script filepath when completing relative paths for using statements (#20017) (Thanks @MartinGC94!)
  • Allow DSC parsing through OS architecture translation layers (#24852) (Thanks @bdeb1337!)

Experimental features

The following experimental features are included in PowerShell 7.6-preview.3: