{"id":18105,"date":"2019-11-21T17:20:37","date_gmt":"2019-11-22T01:20:37","guid":{"rendered":"http:\/\/devblogs.microsoft.com\/powershell\/?p=18105"},"modified":"2019-11-21T18:04:47","modified_gmt":"2019-11-22T02:04:47","slug":"powershell-7-preview-6","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/powershell\/powershell-7-preview-6\/","title":{"rendered":"PowerShell 7 Preview 6"},"content":{"rendered":"<div class=\"markdown-body\">\n<p>Today we shipped <a href=\"https:\/\/github.com\/PowerShell\/PowerShell\/releases\/tag\/v7.0.0-preview.6\">PowerShell 7 Preview.6<\/a>! This release contains a number of new features and many bug fixes from both the community as well as the PowerShell team. See the <a href=\"https:\/\/github.com\/PowerShell\/PowerShell\/releases\/tag\/v7.0.0-preview.6\">Release Notes<\/a> for all the details of what is included in this release.<\/p>\n<p>This will be the <strong>last preview release<\/strong> as we head towards a Release Candidate in December. For the Release Candidate, there will be no more new features although small changes to cmdlets may still be accepted depending on risk of the change. Bug fixes will still be accepted but also accessed for their risk of causing a regression. Finally, we expect General Availability of PowerShell 7 in January as our first Long Term Servicing release.<\/p>\n<h2><a id=\"user-content-new-features-in-preview-6\" class=\"anchor\" href=\"#new-features-in-preview-6\" aria-hidden=\"true\"><\/a>New Features in Preview 6<\/h2>\n<p>This release has a number of new features from both the community as well as the PowerShell team. Remember that preview releases of PowerShell are installed side-by-side with stable versions so you can use both and provide us <a href=\"https:\/\/github.com\/powershell\/powershell\/issues\">feedback<\/a> on previews for bugs and also on experimental features.<\/p>\n<p>You can read about new features in previous preview releases:<\/p>\n<ul>\n<li><a href=\"https:\/\/devblogs.microsoft.com\/powershell\/powershell-7-preview-5\/\" rel=\"nofollow\">PowerShell 7 Preview 5<\/a><\/li>\n<li><a href=\"https:\/\/devblogs.microsoft.com\/powershell\/powershell-7-preview-4\/\" rel=\"nofollow\">PowerShell 7 Preview 4<\/a><\/li>\n<li><a href=\"https:\/\/devblogs.microsoft.com\/powershell\/powershell-7-preview-3\/\" rel=\"nofollow\">PowerShell 7 Preview 3<\/a><\/li>\n<\/ul>\n<p>There were new features in Preview 1 and Preview 2, but I didn&#8217;t blog about them&#8230; sorry!<\/p>\n<h3><a id=\"user-content-skip-error-check-for-web-cmdlets\" class=\"anchor\" href=\"#skip-error-check-for-web-cmdlets\" aria-hidden=\"true\"><\/a>Skip Error Check for Web Cmdlets<\/h3>\n<p>Great addition by community member <a href=\"https:\/\/twitter.com\/vdamewood\" rel=\"nofollow\">Vincent Damewood<\/a> to allow skipping the internal HTTP response error check within the web cmdlets. This means that you can now handle the web error yourself including getting the response object as well as the HTTP response headers whereas previously you would have to get it from the resulting error object.<\/p>\n<p><video controls=\"controls\" width=\"720\" height=\"360\"><source src=\"http:\/\/devblogs.microsoft.com\/powershell\/wp-content\/uploads\/sites\/30\/2019\/11\/SkipHttpErrorCheck.mp4\" type=\"video\/mp4\" \/><\/video><\/p>\n<h3><a id=\"user-content-null-conditional-member-property-and-method-access\" class=\"anchor\" href=\"#null-conditional-member-property-and-method-access\" aria-hidden=\"true\"><\/a>Null Conditional Member Property and Method Access<\/h3>\n<p>This is a new language feature that allows you to skip checking if a variable is <code>$null<\/code> before indexing into the variable, calling a method, or accessing a property. For properties, PowerShell will already allow accesing properties of <code>$null<\/code>, but this new syntax makes it more clear the intent in the script. Note that because PowerShell allows variable names to end with a question mark, you must use braces around the variable name<\/p>\n<p><video controls=\"controls\" width=\"720\" height=\"360\"><source src=\"http:\/\/devblogs.microsoft.com\/powershell\/wp-content\/uploads\/sites\/30\/2019\/11\/Nullmemberaccess.mp4\" type=\"video\/mp4\" \/><\/video><\/p>\n<h3><a id=\"user-content-extended-unix-filesystem-information\" class=\"anchor\" href=\"#extended-unix-filesystem-information\" aria-hidden=\"true\"><\/a>Extended Unix Filesystem Information<\/h3>\n<p>For users of PowerShell on Linux and macOS, they may miss some of the additional information of the filesystem provided by <code>ls -l<\/code> (long form of a directory listing). This new feature makes that information available using <code>Get-ChildItem<\/code> so you are no longer missing any useful information.<\/p>\n<p><video controls=\"controls\" width=\"720\" height=\"360\"><source src=\"http:\/\/devblogs.microsoft.com\/powershell\/wp-content\/uploads\/sites\/30\/2019\/11\/UnixStatFileinfo.mp4\" type=\"video\/mp4\" \/><\/video><\/p>\n<h2><a id=\"user-content-windows-powershell-compatibility-in-preview-6\" class=\"anchor\" href=\"#windows-powershell-compatibility-in-preview-6\" aria-hidden=\"true\"><\/a>Windows PowerShell Compatibility in Preview 6<\/h2>\n<p>This release also improves the compatibility of PowerShell 7 with Windows PowerShell 5.1. We&#8217;ve brought back many existing cmdlets from Windows PowerShell 5.1 thanks to .NET Core 3! In addition, we have a new feature included with PowerShell 7 that encapsulates the <a href=\"https:\/\/github.com\/PowerShell\/WindowsCompatibility\">Windows Compatibility Module<\/a> (more on that below!).<\/p>\n<h3><a id=\"user-content-clipboard-cmdlets\" class=\"anchor\" href=\"#clipboard-cmdlets\" aria-hidden=\"true\"><\/a>Clipboard Cmdlets<\/h3>\n<p><a href=\"https:\/\/docs.microsoft.com\/powershell\/module\/microsoft.powershell.management\/get-clipboard?view=powershell-7\" rel=\"nofollow\"><code>Get-Clipboard<\/code><\/a> and <a href=\"https:\/\/docs.microsoft.com\/powershell\/module\/microsoft.powershell.management\/set-clipboard?view=powershell-7\" rel=\"nofollow\"><code>Set-Clipboard<\/code><\/a> are back! Not only are they available again, but they are cross platform compatible which means you can use them on Linux (requires xclip to be installed) and macOS. Note that only text is supported at this time even on Windows.<\/p>\n<p><video controls=\"controls\" width=\"720\" height=\"360\"><source src=\"http:\/\/devblogs.microsoft.com\/powershell\/wp-content\/uploads\/sites\/30\/2019\/11\/ClipboardCmdlets.mp4\" type=\"video\/mp4\" \/><\/video><\/p>\n<h3><a id=\"user-content-performance-counter-cmdlets\" class=\"anchor\" href=\"#performance-counter-cmdlets\" aria-hidden=\"true\"><\/a>Performance Counter Cmdlets<\/h3>\n<p><a href=\"https:\/\/docs.microsoft.com\/powershell\/module\/microsoft.powershell.diagnostics\/get-counter?view=powershell-7\" rel=\"nofollow\"><code>Get-Counter<\/code><\/a> is back allowing you to get Windows performance counter information. Note that <code>Import-Counter<\/code> and <code>Export-Counter<\/code> cmdlets are not supported in PowerShell 7.<\/p>\n<p><video controls=\"controls\" width=\"720\" height=\"360\"><source src=\"http:\/\/devblogs.microsoft.com\/powershell\/wp-content\/uploads\/sites\/30\/2019\/11\/Get-Counter.mp4\" type=\"video\/mp4\" \/><\/video><\/p>\n<h3><a id=\"user-content-graphical-tools-cmdlets\" class=\"anchor\" href=\"#graphical-tools-cmdlets\" aria-hidden=\"true\"><\/a>Graphical Tools Cmdlets<\/h3>\n<p>With .NET Core 3.0 bringing back WPF support on Windows, we&#8217;ve been able to bring back some popular graphical tools. <a href=\"https:\/\/docs.microsoft.com\/powershell\/module\/microsoft.powershell.utility\/out-gridview?view=powershell-7\" rel=\"nofollow\"><code>Out-GridView<\/code><\/a> gives a dynamic table view of results in a pipeline with sorting and filtering capabilities and when used with <code>-PassThru<\/code> can be used interactively within a pipeline to select objects to send back to the pipeline. <a href=\"https:\/\/docs.microsoft.com\/powershell\/module\/microsoft.powershell.utility\/show-command?view=powershell-7\" rel=\"nofollow\"><code>Show-Command<\/code><\/a> gives a graphical view of a command including parameter sets, parameters, switches, etc&#8230; Finally, <a href=\"https:\/\/docs.microsoft.com\/powershell\/module\/microsoft.powershell.core\/get-help?view=powershell-7\" rel=\"nofollow\"><code>Get-Help<\/code><\/a> <code>-ShowWindow<\/code> works again to give a graphical view of PowerShell help content.<\/p>\n<p><video controls=\"controls\" width=\"720\" height=\"360\"><source src=\"http:\/\/devblogs.microsoft.com\/powershell\/wp-content\/uploads\/sites\/30\/2019\/11\/Out-GridView.mp4\" type=\"video\/mp4\" \/><\/video><\/p>\n<h3><a id=\"user-content-update-list-out-printer-and-clear-recyclebin-cmdlets\" class=\"anchor\" href=\"#update-list-out-printer-and-clear-recyclebin-cmdlets\" aria-hidden=\"true\"><\/a>Update-List, Out-Printer, and Clear-RecycleBin cmdlets<\/h3>\n<p><a href=\"https:\/\/docs.microsoft.com\/powershell\/module\/microsoft.powershell.utility\/update-list?view=powershell-7\" rel=\"nofollow\"><code>Update-List<\/code><\/a> allows adding\/removing items from a property value that contains a collection of objects within a pipeline. This cmdlet is cross-platform compatible.<\/p>\n<p><a href=\"https:\/\/docs.microsoft.com\/powershell\/module\/microsoft.powershell.utility\/out-printer?view=powershell-7\" rel=\"nofollow\"><code>Out-Printer<\/code><\/a> sends a PowerShell object to the printer. This cmdlet is only supported on Windows currently.<\/p>\n<p><a href=\"https:\/\/docs.microsoft.com\/powershell\/module\/microsoft.powershell.management\/clear-recyclebin?view=powershell-7\" rel=\"nofollow\"><code>Clear-RecycleBin<\/code><\/a> empties the recycle bin and is currently only supported on Windows.<\/p>\n<p><video controls=\"controls\" width=\"720\" height=\"360\"><source src=\"http:\/\/devblogs.microsoft.com\/powershell\/wp-content\/uploads\/sites\/30\/2019\/11\/Update-ListOut-PrinterClear-Recy.mp4\" type=\"video\/mp4\" \/><\/video><\/p>\n<h3><a id=\"user-content-test-connection-improvements\" class=\"anchor\" href=\"#test-connection-improvements\" aria-hidden=\"true\"><\/a>Test-Connection Improvements<\/h3>\n<p>The original implementation of <a href=\"https:\/\/docs.microsoft.com\/powershell\/module\/microsoft.powershell.management\/test-connection?view=powershell-7\" rel=\"nofollow\"><code>Test-Connection<\/code><\/a> in Windows PowerShell relied on WMI which made it not cross-platform compatible.<\/p>\n<p>Community member and PowerShell repo maintainer <a href=\"https:\/\/github.com\/isazonov\">Ilya Sazonov<\/a> ported the cmdlet to work against .NET Core APIs in PowerShell Core 6 making it work cross-platform. However, this also changed the user experience.<\/p>\n<p>For PowerShell 7, <a href=\"https:\/\/twitter.com\/vexx32\" rel=\"nofollow\">Joel Sallow<\/a>, another community member made improvements to this cmdlet and also getting back to similar experience as the original cmdlet in Windows PowerShell.<\/p>\n<p><video controls=\"controls\" width=\"720\" height=\"360\"><source src=\"http:\/\/devblogs.microsoft.com\/powershell\/wp-content\/uploads\/sites\/30\/2019\/11\/Test-Connection.mp4\" type=\"video\/mp4\" \/><\/video><\/p>\n<h3><a id=\"user-content-import-windows-powershell-modules-in-ps7\" class=\"anchor\" href=\"#import-windows-powershell-modules-in-ps7\" aria-hidden=\"true\"><\/a>Import Windows PowerShell Modules in PS7<\/h3>\n<p>For PowerShell Core 6, we introduced the <a href=\"https:\/\/github.com\/PowerShell\/WindowsCompatibility\">Windows Compatibility Module<\/a> to allow importing Windows PowerShell modules that were not compatible with PowerShell Core 6 leveraging WinRM and <a href=\"https:\/\/devblogs.microsoft.com\/scripting\/remoting-the-implicit-way\/\" rel=\"nofollow\">implicit remoting<\/a>.<\/p>\n<p>In PowerShell 7, we have included this functionality into <a href=\"https:\/\/docs.microsoft.com\/powershell\/module\/microsoft.powershell.core\/import-module?view=powershell-7\" rel=\"nofollow\"><code>Import-Module<\/code><\/a> directly without relying on WinRM, but does rely on Windows PowerShell 5.1 (it won&#8217;t work if Windows PowerShell 5.1 is not available).<\/p>\n<p>Basically, for modules in the System32 folder, if the module manifest doesn&#8217;t indicate that module is compatible with <code>Core<\/code> then that module will be loaded in a Windows PowerShell process and using implicit remoting reflected into your PowerShell 7 session.<\/p>\n<p>More details of this feature along with other information regarding Windows PowerShell compatibility in general coming in a separate blog post.<\/p>\n<p><video controls=\"controls\" width=\"720\" height=\"360\"><source src=\"http:\/\/devblogs.microsoft.com\/powershell\/wp-content\/uploads\/sites\/30\/2019\/11\/WinPSWrapper.mp4\" type=\"video\/mp4\" \/><\/video><\/p>\n<h2><a id=\"user-content-closing\" class=\"anchor\" href=\"#closing\" aria-hidden=\"true\"><\/a>Closing<\/h2>\n<p>These are the last of the big changes coming in PowerShell 7 as we heads toward a Release Candidate next month. Please try out this preview and report issues in our <a href=\"https:\/\/github.com\/powershell\/powershell\/issues\">GitHub repo<\/a> as we still have opportunity to fix existing bugs as well as new bugs introduced by these features.<\/p>\n<p>Thanks!<\/p>\n<p>Steve Lee\nPowerShell Team<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Today we shipped PowerShell 7 Preview.6! This release contains a number of new features and many bug fixes from both the community as well as the PowerShell team. See the Release Notes for all the details of what is included in this release. This will be the last preview release as we head towards a [&hellip;]<\/p>\n","protected":false},"author":685,"featured_media":13641,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-18105","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-powershell"],"acf":[],"blog_post_summary":"<p>Today we shipped PowerShell 7 Preview.6! This release contains a number of new features and many bug fixes from both the community as well as the PowerShell team. See the Release Notes for all the details of what is included in this release. This will be the last preview release as we head towards a [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/posts\/18105","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/users\/685"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/comments?post=18105"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/posts\/18105\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/media\/13641"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/media?parent=18105"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/categories?post=18105"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/tags?post=18105"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}