{"id":19245,"date":"2021-11-08T08:15:18","date_gmt":"2021-11-08T16:15:18","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/powershell\/?p=19245"},"modified":"2021-11-08T08:15:18","modified_gmt":"2021-11-08T16:15:18","slug":"general-availability-of-powershell-7-2","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/powershell\/general-availability-of-powershell-7-2\/","title":{"rendered":"General Availability of PowerShell 7.2"},"content":{"rendered":"<h2>General Availability of PowerShell 7.2<\/h2>\n<p>We&#8217;re pleased to announce the General Availability of PowerShell 7.2!\nThis release continues our even numbered minor version releases as Long Term Support (LTS).\nThe odd numbered minor versions will continue to have a 1 year support lifecycle.\nThis means that this release will be supported in production for 3 years (end of support would be around end of 2024).<\/p>\n<p>This release is built on <a href=\"https:\/\/devblogs.microsoft.com\/dotnet\/announcing-net-6\">.NET 6<\/a>!\nThis includes many performance improvements, bug fixes, and new APIs to use in your scripts.<\/p>\n<p>Our last LTS release was <a href=\"https:\/\/devblogs.microsoft.com\/powershell\/announcing-PowerShell-7-0\/\">PowerShell 7.0<\/a> which means that\nthere is a 1 year overlap where PowerShell 7.0 is still supported and 7.2 is available.\nWe would recommend using this time to evaluate 7.2 and <a href=\"https:\/\/github.com\/PowerShell\/PowerShell\/issues\">report any issues<\/a> that\nwould prevent migration to 7.2 from 7.0.<\/p>\n<h2>How to get it?<\/h2>\n<p>Depending on your operating system, there are a number of ways to <a href=\"https:\/\/docs.microsoft.com\/powershell\/scripting\/install\/installing-powershell\">install PowerShell 7<\/a>.<\/p>\n<p>On Windows, starting with 7.2, if you install using the <a href=\"https:\/\/docs.microsoft.com\/powershell\/scripting\/install\/installing-powershell-on-windows#msi\">MSI<\/a> package,\nthen PowerShell 7 will be setup to automatically update via Microsoft Update.<\/p>\n<p>Alternatively, if you install from the <a href=\"https:\/\/docs.microsoft.com\/powershell\/scripting\/install\/installing-powershell-on-windows#msstore\">Microsoft Store<\/a>, then\nPowerShell 7 will also be automatically updated, however, you would need to install the MSI on Windows Server to get the automatic update capability as the\nMicroosft Store is not supported on Windows Server.\nThe Microsoft Store release has both stable and preview release channels which work side-by-side should you have both installed.<\/p>\n<p>On <a href=\"https:\/\/docs.microsoft.com\/powershell\/scripting\/install\/installing-powershell-on-linux\">Linux<\/a> and <a href=\"https:\/\/docs.microsoft.com\/powershell\/scripting\/install\/installing-powershell-on-macos\">macOS<\/a>,\nyou would continue to update using the same method you used to install.<\/p>\n<h2>What&#8217;s new?<\/h2>\n<p>We have a more comprehensive doc on <a href=\"https:\/\/docs.microsoft.com\/powershell\/scripting\/whats-new\/what-s-new-in-powershell-72\">what&#8217;s new in 7.2<\/a>,\nbut here are some highlights:<\/p>\n<h3>Microsoft Update support<\/h3>\n<p>As noted above, we have integration with Microsoft Update to automatically keep your installation of 7.2 updated whenever\nwe have a servicing release which only includes critical bug fixes or security updates.<\/p>\n<p>The MSI installer will automatically enable updating PowerShell 7 as well as enabling Microsoft Update.\nYou can choose to opt out of the automatic update during install if you prefer to manually update PowerShell 7 yourself.<\/p>\n<p>For Microsoft Update, we continue to have both preview and stable channels (where you can use both side-by-side).\nSo if you have a preview of 7.2 installed and enabled Microsoft Update, then you will be updated to 7.3 preview once that is available.\nYou would need to install 7.2 GA separately to have Microsoft Update enabled for our stable channel where you would be updated to\n7.2.1 should we have a servicing release and eventually to 7.3 GA.<\/p>\n<h3>Enhanced ANSI support<\/h3>\n<p><a href=\"https:\/\/en.wikipedia.org\/wiki\/ANSI_escape_code\">ANSI escape sequences<\/a> are an industry standard way to provide text decoration support\n(among other capabilities in the terminal) between the console and a <a href=\"https:\/\/github.com\/Microsoft\/Terminal\">supported terminal<\/a>.<\/p>\n<p>Use of these decorations is a common way for command-line tools and shells to highlight or distinguish information.\nFor example, a new feature in 7.2 is to use a different color for metadata vs data when using a table or list view:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/powershell\/wp-content\/uploads\/sites\/30\/2021\/11\/colors_table_list.png\" alt=\"Color table and list\" \/><\/p>\n<p>In 7.2, we&#8217;ve added a new built-in variable called <code>$PSStyle<\/code> to make it easy to add decoration to your scripts or cmdlets\nas well as control use of ANSI escape sequences.\nYou can use this to add coloring, italics, background colors, etc.. and because it&#8217;s a variable, you can use tab-completion to\ndiscover what you can do.<\/p>\n<p>Here&#8217;s an example to decorate some text:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/powershell\/wp-content\/uploads\/sites\/30\/2021\/11\/Colors.png\" alt=\"Decorated text example\" \/><\/p>\n<p>The <code>$PSStyle<\/code> variable also lets you customize the colors and decorations being used.\nFor example, you may prefer something more subtle for table headers than the default green color:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/powershell\/wp-content\/uploads\/sites\/30\/2021\/11\/subtle_colors_table.png\" alt=\"Subtle color example\" \/><\/p>\n<p>Any customizations would need to be stored in your <a href=\"https:\/\/docs.microsoft.com\/powershell\/module\/microsoft.powershell.core\/about\/about_profiles\"><code>$Profile<\/code><\/a> to be retained.<\/p>\n<p>You can find more about <code>$PSStyle<\/code> and ANSI in our documentation about using an <a href=\"https:\/\/docs.microsoft.com\/powershell\/module\/microsoft.powershell.core\/about\/about_ansi_terminals\">ANSI terminal<\/a>.<\/p>\n<h3>Predictive Intellisense with PSReadLine<\/h3>\n<p>This is a feature in PSReadLine 2.1 which ships with PowerShell 7.2.\nTo make the interactive console more productive, particularly with repetitive tasks, we&#8217;ve added a feature to use your history to predict\nwhat you may be typing.\nThis feature must be enabled and you can also customize the colors used for the predictive text.\nHere, I&#8217;ve changed the default color to something more visible.\nYou would use the right arrow key to accept the prediction or keep typing which can affect the prediction.<\/p>\n<p><div style=\"width: 640px;\" class=\"wp-video\"><video class=\"wp-video-shortcode\" id=\"video-19245-1\" width=\"640\" height=\"360\" preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"https:\/\/devblogs.microsoft.com\/powershell\/wp-content\/uploads\/sites\/30\/2021\/11\/prediction.mp4?_=1\" \/><a href=\"https:\/\/devblogs.microsoft.com\/powershell\/wp-content\/uploads\/sites\/30\/2021\/11\/prediction.mp4\">https:\/\/devblogs.microsoft.com\/powershell\/wp-content\/uploads\/sites\/30\/2021\/11\/prediction.mp4<\/a><\/video><\/div><\/p>\n<p>You can read more about it in our previous <a href=\"https:\/\/devblogs.microsoft.com\/powershell\/announcing-psreadline-2-1-with-predictive-intellisense\/\">blog post<\/a> specifically on this feature\nas well as leveraging the <a href=\"https:\/\/techcommunity.microsoft.com\/t5\/azure-tools\/announcing-az-predictor-preview-5\/ba-p\/2197744\">Az Predictor plugin<\/a> for AzPowerShell specific\npredictions.<\/p>\n<h3>Other improvements<\/h3>\n<p>There are numerous bug fixes and small improvements where a number of them came from the community!\nYou can read the details in our <a href=\"https:\/\/github.com\/PowerShell\/PowerShell\/releases\">changelogs<\/a> or the summary in our\n<a href=\"https:\/\/docs.microsoft.com\/powershell\/scripting\/whats-new\/what-s-new-in-powershell-72\">What&#8217;s new documentation<\/a><\/p>\n<h2>What&#8217;s next?<\/h2>\n<p>Development will continue with PowerShell 7.3.\nThe changes that have been made that didn&#8217;t meet the bar for 7.2 will be in the first preview of 7.3.\nA more detailed plan for PowerShell team investments during the 7.3 timeframe (calendar year 2022) will be published in the first quarter of 2022.<\/p>\n<p>Much thanks to our team members, community contributors, community working group members, and the .NET team for making this release possible!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Announcing general availability of PowerShell 7.2<\/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":[248],"class_list":["post-19245","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-powershell","tag-powershell"],"acf":[],"blog_post_summary":"<p>Announcing general availability of PowerShell 7.2<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/posts\/19245","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=19245"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/posts\/19245\/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=19245"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/categories?post=19245"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/tags?post=19245"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}