{"id":18268,"date":"2020-03-06T13:44:36","date_gmt":"2020-03-06T21:44:36","guid":{"rendered":"http:\/\/devblogs.microsoft.com\/powershell\/?p=18268"},"modified":"2020-03-06T14:35:45","modified_gmt":"2020-03-06T22:35:45","slug":"introducing-consoleguitools-preview","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/powershell\/introducing-consoleguitools-preview\/","title":{"rendered":"A new kind of GridView right in your console: Introducing the early preview of ConsoleGuiTools"},"content":{"rendered":"<div class=\"markdown-body\">\n<p>Yes. This is yet another post about GridViews. We love them. You love them. What&#8217;s not to like?<\/p>\n<p>If you&#8217;re not familiar with <code>Out-GridView<\/code>, it can be used to interactively view objects as a table allowing sorting and filtering. Many PowerShell users like to use it within a pipeline for interactive selection of objects that get processed later in the pipeline.<\/p>\n<p>Let&#8217;s recap where we&#8217;re at with respect to GridViews:<\/p>\n<ul>\n<li>PowerShell 7 (<a href=\"https:\/\/devblogs.microsoft.com\/powershell\/announcing-powershell-7-0\/\" rel=\"nofollow\">which GA&#8217;d recently!<\/a>) brought back the old WinForm-based <code>Out-GridView<\/code> from Windows PowerShell.<\/li>\n<li>We released the <a href=\"https:\/\/devblogs.microsoft.com\/powershell\/out-gridview-returns\/\" rel=\"nofollow\">Microsoft.PowerShell.GraphicalTools<\/a> module which provided a cross-platform (Windows, macOS &amp; Linux) <code>Out-GridView<\/code> cmdlet based on <a href=\"https:\/\/github.com\/AvaloniaUI\/Avalonia\">AvaloniaUI<\/a>.<\/li>\n<li>Community members have also implemented both <a href=\"https:\/\/evotec.xyz\/out-htmlview-html-alternative-to-out-gridview\/\" rel=\"nofollow\">cross-platform<\/a> and <a href=\"https:\/\/github.com\/charlieschmidt\/PSmacOS\">native solutions<\/a> for providing an Out-GridView functionality on macOS and Linux.<\/li>\n<\/ul>\n<p>Today, I have the exciting opportunity to talk about a new <code>GridView<\/code>.<\/p>\n<h2><a id=\"user-content-introducing-the-microsoftpowershellconsoleguitools-module-now-in-preview\" class=\"anchor\" href=\"#introducing-the-microsoftpowershellconsoleguitools-module-now-in-preview\" aria-hidden=\"true\"><\/a>Introducing the <code>Microsoft.PowerShell.ConsoleGuiTools<\/code> module now in Preview<\/h2>\n<p>The <code>Microsoft.PowerShell.ConsoleGuiTools<\/code> is a module that will contain a set of cmdlets that enable console-based GUIs. Today, it contains one very important cmdlet: <code>Out-ConsoleGridView<\/code>.<\/p>\n<pre class=\"lang:ps decode:true\">Get-Process | Out-ConsoleGridView<\/pre>\n<p><a href=\"https:\/\/camo.githubusercontent.com\/6dcf4cfc27a2eeb2fc555ff4bb774b4d83b5fb7c\/68747470733a2f2f646576626c6f67732e6d6963726f736f66742e636f6d2f706f7765727368656c6c2f77702d636f6e74656e742f75706c6f6164732f73697465732f33302f323032302f30332f37363131343332342d61653263646630302d356639612d313165612d383030362d6466616462343035303962662e706e67\" target=\"_blank\" rel=\"nofollow noopener noreferrer\"><img decoding=\"async\" style=\"max-width: 100%;\" src=\"https:\/\/camo.githubusercontent.com\/6dcf4cfc27a2eeb2fc555ff4bb774b4d83b5fb7c\/68747470733a2f2f646576626c6f67732e6d6963726f736f66742e636f6d2f706f7765727368656c6c2f77702d636f6e74656e742f75706c6f6164732f73697465732f33302f323032302f30332f37363131343332342d61653263646630302d356639612d313165612d383030362d6466616462343035303962662e706e67\" alt=\"Out-ConsoleGridView screen\" data-canonical-src=\"https:\/\/devblogs.microsoft.com\/powershell\/wp-content\/uploads\/sites\/30\/2020\/03\/76114324-ae2cdf00-5f9a-11ea-8006-dfadb40509bf.png\" \/><\/a><\/p>\n<p>This shows up right in the same console window you were using without launching any outside process. This module leverages the incredibly powerful and cross-platform <a href=\"https:\/\/github.com\/migueldeicaza\/gui.cs\"><code>gui.cs<\/code><\/a> library by <a href=\"https:\/\/github.com\/migueldeicaza\">Miguel de Icaza<\/a>.<\/p>\n<p>Oh yeah, it also supports <code>-PassThru<\/code>!<\/p>\n<pre class=\"lang:ps decode:true\">Get-ChildItem | Out-ConsoleGridView -PassThru<\/pre>\n<p><a href=\"https:\/\/camo.githubusercontent.com\/ea2fd6696f8b52bac9ef68630cbfc94ffecbad82\/68747470733a2f2f646576626c6f67732e6d6963726f736f66742e636f6d2f706f7765727368656c6c2f77702d636f6e74656e742f75706c6f6164732f73697465732f33302f323032302f30332f37363131353034382d34363737393338302d356639632d313165612d386164612d3833653761373363306433632e676966\" target=\"_blank\" rel=\"nofollow noopener noreferrer\"><img decoding=\"async\" style=\"max-width: 100%;\" src=\"https:\/\/camo.githubusercontent.com\/ea2fd6696f8b52bac9ef68630cbfc94ffecbad82\/68747470733a2f2f646576626c6f67732e6d6963726f736f66742e636f6d2f706f7765727368656c6c2f77702d636f6e74656e742f75706c6f6164732f73697465732f33302f323032302f30332f37363131353034382d34363737393338302d356639632d313165612d386164612d3833653761373363306433632e676966\" alt=\"PassThru works\" data-canonical-src=\"https:\/\/devblogs.microsoft.com\/powershell\/wp-content\/uploads\/sites\/30\/2020\/03\/76115048-46779380-5f9c-11ea-8ada-83e7a73c0d3c.gif\" \/><\/a><\/p>\n<p>In that last gif, you might have also noticed that mouse clicks work in the <code>Actions<\/code> menu!<\/p>\n<h2><a id=\"user-content-installation\" class=\"anchor\" href=\"#installation\" aria-hidden=\"true\"><\/a>Installation<\/h2>\n<p>If you want to get this right now:<\/p>\n<pre class=\"lang:ps decode:true\">Install-Module Microsoft.PowerShell.ConsoleGuiTools<\/pre>\n<h2><a id=\"user-content-features\" class=\"anchor\" href=\"#features\" aria-hidden=\"true\"><\/a>Features<\/h2>\n<h3><a id=\"user-content-passthru\" class=\"anchor\" href=\"#passthru\" aria-hidden=\"true\"><\/a>PassThru<\/h3>\n<p>One of the most powerful features, the <code>-PassThru<\/code> parameter lets you use the GUI to select data to send further down the pipeline.<\/p>\n<pre class=\"lang:ps decode:true\">Get-Process | Out-GridView -PassThru | Stop-Process<\/pre>\n<p>If you were so inclined the above script uses <code>-PassThru<\/code> to create a pretty effective emulation of a Process Manger.<\/p>\n<h3><a id=\"user-content-mouse-clicks-and-keyboard-support\" class=\"anchor\" href=\"#mouse-clicks-and-keyboard-support\" aria-hidden=\"true\"><\/a>Mouse clicks and keyboard support<\/h3>\n<p>You can click on the actions menu, dialogs and grid view using your mouse.<\/p>\n<p>You can also use your keyboard:<\/p>\n<ul>\n<li><kbd>Spacebar<\/kbd>: marks one of the items in the grid view with an <code>x<\/code> if you used the <code>PassThru<\/code> parameter<\/li>\n<li><kbd>F9<\/kbd>: opens the Action menu<\/li>\n<li><kbd>ESC<\/kbd>: closes the Action menu<\/li>\n<li>Arrow keys: move around<\/li>\n<li><kbd>ENTER<\/kbd>: Choose an Action or answer a dialog<\/li>\n<\/ul>\n<blockquote><p>NOTE: At this time you can&#8217;t mark items in the grid view with mouse click. That will be available in the next version of gui.cs which will likely be the next version of ConsoleGuiTools<\/p><\/blockquote>\n<h3><a id=\"user-content-azure-cloud-shell-support\" class=\"anchor\" href=\"#azure-cloud-shell-support\" aria-hidden=\"true\"><\/a>Azure Cloud Shell support<\/h3>\n<p><a href=\"https:\/\/camo.githubusercontent.com\/0cc66144292a2116f6d9b24602dc2749438f150f\/68747470733a2f2f646576626c6f67732e6d6963726f736f66742e636f6d2f706f7765727368656c6c2f77702d636f6e74656e742f75706c6f6164732f73697465732f33302f323032302f30332f37363131373433392d62326634393138302d356661302d313165612d393166302d3939343832383238363033612e706e67\" target=\"_blank\" rel=\"nofollow noopener noreferrer\"><img decoding=\"async\" style=\"max-width: 100%;\" src=\"https:\/\/camo.githubusercontent.com\/0cc66144292a2116f6d9b24602dc2749438f150f\/68747470733a2f2f646576626c6f67732e6d6963726f736f66742e636f6d2f706f7765727368656c6c2f77702d636f6e74656e742f75706c6f6164732f73697465732f33302f323032302f30332f37363131373433392d62326634393138302d356661302d313165612d393166302d3939343832383238363033612e706e67\" alt=\"Azure Cloud Shell support\" data-canonical-src=\"https:\/\/devblogs.microsoft.com\/powershell\/wp-content\/uploads\/sites\/30\/2020\/03\/76117439-b2f49180-5fa0-11ea-91f0-99482828603a.png\" \/><\/a><\/p>\n<p>Since the Console GUIs (or CUIs) in <code>Microsoft.PowerShell.ConsoleGuiTools<\/code> show up in the same console you&#8217;re prompt is in, support for environments that don&#8217;t supply a GUI but have a terminal emulators, like Azure Cloud Shell, work out of the box.<\/p>\n<p>In fact, the gif in this very blog post was recorded in Azure Cloud Shell!<\/p>\n<p>This is <code>Microsoft.PowerShell.ConsoleGuiTools<\/code> differentiating feature to other <code>Out-GridView<\/code>s. It&#8217;s a GUI tool, without needing a GUI.<\/p>\n<p>Install it in Cloud Shell and let us know what you think!<\/p>\n<h2><a id=\"user-content-limitations\" class=\"anchor\" href=\"#limitations\" aria-hidden=\"true\"><\/a>Limitations<\/h2>\n<p>Currently, the <code>Microsoft.PowerShell.ConsoleGuiTools<\/code> module works only on macOS and Linux due to <a href=\"https:\/\/github.com\/migueldeicaza\/gui.cs\/issues\/339\">a known <code>gui.cs<\/code> issue on Windows<\/a>.<\/p>\n<p>Since Windows has multiple other options for GridView&#8217;s we felt that this was a reasonable limitation for now.<\/p>\n<h2><a id=\"user-content-the-future\" class=\"anchor\" href=\"#the-future\" aria-hidden=\"true\"><\/a>The Future<\/h2>\n<p>The <code>Microsoft.PowerShell.ConsoleGuiTools<\/code> module is still in preview. We&#8217;re looking for your feedback to make sure we&#8217;re on the right track for supporting this. Please don&#8217;t hesitate to open issues and feature requests over in the <a href=\"https:\/\/github.com\/PowerShell\/GraphicalTools\">GraphicalTools repo<\/a> which is home to both the <code>Microsoft.PowerShell.GraphicalTools<\/code> module and the <code>Microsoft.PowerShell.ConsoleGuiTools<\/code> module.<\/p>\n<p>We are looking for a community member to help port <a href=\"https:\/\/docs.microsoft.com\/powershell\/module\/microsoft.powershell.utility\/show-command?view=powershell-5.1\" rel=\"nofollow\"><code>Show-Command<\/code><\/a> and <a href=\"http:\/\/powershellcookbook.com\/recipe\/bpqU\/program-interactively-view-and-explore-objects\" rel=\"nofollow\"><code>Show-Object<\/code><\/a> to ConsoleGuiTools. Check out the <a href=\"https:\/\/github.com\/Powershell\/GraphicalTools\">repository<\/a> and post in the <a href=\"https:\/\/github.com\/PowerShell\/GraphicalTools\/issues\/15\">issue tracking <code>Show-Command<\/code><\/a> if you&#8217;re interested.<\/p>\n<p>With the majority of the brunt work integrating PowerShell &amp; gui.cs done, we are also open to submissions for new graphical commands or packages.<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Yes. This is yet another post about GridViews. We love them. You love them. What&#8217;s not to like? If you&#8217;re not familiar with Out-GridView, it can be used to interactively view objects as a table allowing sorting and filtering. Many PowerShell users like to use it within a pipeline for interactive selection of objects that [&hellip;]<\/p>\n","protected":false},"author":18107,"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-18268","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-powershell"],"acf":[],"blog_post_summary":"<p>Yes. This is yet another post about GridViews. We love them. You love them. What&#8217;s not to like? If you&#8217;re not familiar with Out-GridView, it can be used to interactively view objects as a table allowing sorting and filtering. Many PowerShell users like to use it within a pipeline for interactive selection of objects that [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/posts\/18268","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\/18107"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/comments?post=18268"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/posts\/18268\/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=18268"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/categories?post=18268"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/tags?post=18268"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}