{"id":586,"date":"2014-10-05T00:01:00","date_gmt":"2014-10-05T00:01:00","guid":{"rendered":"https:\/\/blogs.technet.microsoft.com\/heyscriptingguy\/2014\/10\/05\/weekend-scripter-give-your-powershell-console-a-glassy-theme\/"},"modified":"2014-10-05T00:01:00","modified_gmt":"2014-10-05T00:01:00","slug":"weekend-scripter-give-your-powershell-console-a-glassy-theme","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/scripting\/weekend-scripter-give-your-powershell-console-a-glassy-theme\/","title":{"rendered":"Weekend Scripter: Give Your PowerShell Console a Glassy Theme"},"content":{"rendered":"<p><b style=\"font-size:12px\">Summary<\/b><span style=\"font-size:12px\">: Boe Prox shows how to give the Windows PowerShell console a glass-like look.<\/span><\/p>\n<p>Honorary Scripting Guy, Boe Prox, here today filling in for my good friend, The Scripting Guy.<\/p>\n<p>Have you ever sat at your desk while working in the Windows PowerShell console and thought, &ldquo;Wouldn&rsquo;t it be great if this console had a more unique look? Perhaps something like a glassy look?&rdquo;<\/p>\n<p>Well, if that is the case, then you are in luck! I am going to take you through the process of turning your Windows PowerShell console into a glassy console. It may not improve your scripting, but at least it will make others take a second look at your screen and ask you, &quot;What is that window you are typing in?&quot;<\/p>\n<p>To accomplish this feat, I have to dive into the world of platform invoke (<b>p\/invoke<\/b>) and get a little dirty in the world of Win32 APIs. Fortunately, there is an amazing site (<a href=\"http:\/\/pinvoke.net\/\" target=\"_blank\">What is PInvoke.net?<\/a>). It is dedicated to this subject by providing signatures for a lot of these APIs, which we can take advantage of.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/GlassyPowerShell1.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/GlassyPowerShell1.png\" alt=\"Image of code\" title=\"Image of code\" \/><\/a><\/p>\n<p style=\"margin-left:30px\"><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/GlassyPowerShell2.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/GlassyPowerShell2.png\" alt=\"Image of code\" title=\"Image of code\" \/><\/a><\/p>\n<p>As you can see from the previous images, I will be using the <b>dwmextendframeintoclientarea<\/b> and <b>DwmIsCompositionEnabled<\/b> functions available in dwmapi.dll. Typically, we would push out some C# code in a <b>Here-String<\/b>, compile all of that (along with anything else that is required for this to work) by using <b>Add-Type<\/b>, and then load it into a Windows PowerShell session.<\/p>\n<p>But today will be different because I am going to take an alternate route by using Reflection to load everything into memory vs. compiling to a file. Why am I doing this? Because it provides an alternate way to perform this action.<\/p>\n<p>Let&rsquo;s get the ball rolling by first creating a module builder that will serve as the foundation for the remainder of the things I will be building:<\/p>\n<p style=\"margin-left:30px\">#region Module Builder<\/p>\n<p style=\"margin-left:30px\">$Domain = [AppDomain]::CurrentDomain<\/p>\n<p style=\"margin-left:30px\">$DynAssembly = New-Object System.Reflection.AssemblyName(&#039;AeroAssembly&#039;)<\/p>\n<p style=\"margin-left:30px\"># Only run in memory<\/p>\n<p style=\"margin-left:30px\">$AssemblyBuilder = $Domain.DefineDynamicAssembly($DynAssembly, [System.Reflection.Emit.AssemblyBuilderAccess]::Run)<\/p>\n<p style=\"margin-left:30px\">$ModuleBuilder = $AssemblyBuilder.DefineDynamicModule(&#039;AeroModule&#039;, $False)<\/p>\n<p style=\"margin-left:30px\">#endregion Module Builder<\/p>\n<p>Here I am building an assembly (all in memory) called <b>AeroAssembly<\/b> and then building the module.<\/p>\n<p>Up next is a requirement by one of the functions to have a Struct available to support the margins of a window (in this case, the Windows PowerShell console). To create this, I need to use my Module Builder.<\/p>\n<p style=\"margin-left:30px\">#region STRUCTs<span style=\"font-size:12px\">&nbsp;<\/span><\/p>\n<p style=\"margin-left:30px\">\n<p style=\"margin-left:30px\">#region Margins<\/p>\n<p style=\"margin-left:30px\">$Attributes = &#039;AutoLayout, AnsiClass, Class, Public, SequentialLayout, Sealed, BeforeFieldInit&#039;<\/p>\n<p style=\"margin-left:30px\">$TypeBuilder = $ModuleBuilder.DefineType(&#039;MARGINS&#039;, $Attributes, [System.ValueType], 1, 0x10)<\/p>\n<p style=\"margin-left:30px\">[void]$TypeBuilder.DefineField(&#039;left&#039;, [Int], &#039;Public&#039;)<\/p>\n<p style=\"margin-left:30px\">[void]$TypeBuilder.DefineField(&#039;right&#039;, [Int], &#039;Public&#039;)<\/p>\n<p style=\"margin-left:30px\">[void]$TypeBuilder.DefineField(&#039;top&#039;, [Int], &#039;Public&#039;)<\/p>\n<p style=\"margin-left:30px\">[void]$TypeBuilder.DefineField(&#039;bottom&#039;, [Int], &#039;Public&#039;)<\/p>\n<p>&nbsp;<\/p>\n<p style=\"margin-left:30px\">#Create STRUCT Type<\/p>\n<p style=\"margin-left:30px\">[void]$TypeBuilder.CreateType()<\/p>\n<p style=\"margin-left:30px\">#endregion Margins<\/p>\n<p>&nbsp;<\/p>\n<p style=\"margin-left:30px\">#endregion STRUCTs<\/p>\n<p>Now that I have my Struct created, I can simply create the object like this:<\/p>\n<p style=\"margin-left:30px\">PS C:\\&gt; New-Object MARGINS<\/p>\n<p>&nbsp;<\/p>\n<p style=\"margin-left:30px\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; left&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; right&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; top&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; bottom<\/p>\n<p style=\"margin-left:30px\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8212;-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8212;&#8211;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8212;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8212;&#8212;<\/p>\n<p style=\"margin-left:30px\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0<\/p>\n<p>Next I begin to build my type&mdash;the PInvoke functions will be used as methods from this. This is similar to when you call methods from a type accelerator, such as <b>[math]<\/b>.<\/p>\n<p style=\"margin-left:30px\">#region DllImport<\/p>\n<p style=\"margin-left:30px\">$TypeBuilder = $ModuleBuilder.DefineType(&#039;Aero&#039;, &#039;Public, Class&#039;)<\/p>\n<p>The Aero type has not actually been created yet, so attempts to call it by <b>[Aero]<\/b> will end in failure. The next step is to begin defining the functions and loading them into the type as methods.<\/p>\n<p style=\"margin-left:30px\">#region DwmExtendFrameIntoClientArea Method<\/p>\n<p style=\"margin-left:30px\">$PInvokeMethod = $TypeBuilder.DefineMethod(<\/p>\n<p style=\"margin-left:30px\">&nbsp;&nbsp;&nbsp; &#039;DwmExtendFrameIntoClientArea&#039;, #Method Name<\/p>\n<p style=\"margin-left:30px\">&nbsp;&nbsp;&nbsp; [Reflection.MethodAttributes] &#039;PrivateScope, Public, Static, HideBySig, PinvokeImpl&#039;, #Method Attributes<\/p>\n<p style=\"margin-left:30px\">&nbsp;&nbsp;&nbsp; [Void], #Method Return Type<\/p>\n<p style=\"margin-left:30px\">&nbsp;&nbsp;&nbsp; [Type[]] @([IntPtr],[Margins]) #Method Parameters<\/p>\n<p style=\"margin-left:30px\">)<\/p>\n<p>&nbsp;<\/p>\n<p style=\"margin-left:30px\">$DllImportConstructor = [Runtime.InteropServices.DllImportAttribute].GetConstructor(@([String]))<\/p>\n<p style=\"margin-left:30px\">$FieldArray = [Reflection.FieldInfo[]] @(<\/p>\n<p style=\"margin-left:30px\">&nbsp;&nbsp;&nbsp; [Runtime.InteropServices.DllImportAttribute].GetField(&#039;EntryPoint&#039;),<\/p>\n<p style=\"margin-left:30px\">&nbsp;&nbsp;&nbsp; [Runtime.InteropServices.DllImportAttribute].GetField(&#039;PreserveSig&#039;)<\/p>\n<p style=\"margin-left:30px\">)<\/p>\n<p>&nbsp;<\/p>\n<p style=\"margin-left:30px\">$FieldValueArray = [Object[]] @(<\/p>\n<p style=\"margin-left:30px\">&nbsp;&nbsp;&nbsp; &#039;DwmExtendFrameIntoClientArea&#039;, #CASE SENSITIVE!!<\/p>\n<p style=\"margin-left:30px\">&nbsp;&nbsp;&nbsp; $False<\/p>\n<p style=\"margin-left:30px\">)<\/p>\n<p>&nbsp;<\/p>\n<p style=\"margin-left:30px\">$CustomAttributeBuilder = New-Object Reflection.Emit.CustomAttributeBuilder(<\/p>\n<p style=\"margin-left:30px\">&nbsp;&nbsp;&nbsp; $DllImportConstructor,<\/p>\n<p style=\"margin-left:30px\">&nbsp;&nbsp;&nbsp; @(&#039;dwmapi.dll&#039;),<\/p>\n<p style=\"margin-left:30px\">&nbsp;&nbsp;&nbsp; $FieldArray,<\/p>\n<p style=\"margin-left:30px\">&nbsp;&nbsp;&nbsp; $FieldValueArray<\/p>\n<p style=\"margin-left:30px\">)<\/p>\n<p>&nbsp;<\/p>\n<p style=\"margin-left:30px\">$PInvokeMethod.SetCustomAttribute($CustomAttributeBuilder)<\/p>\n<p style=\"margin-left:30px\">#endregion DwmExtendFrameIntoClientArea Method<\/p>\n<p>Here I use my type to begin defining the methods. In the images that I showed earlier define the expected return type of the function (in this case, it is <b>[void]<\/b>, even though the signature shows <b>INT<\/b>, so I do not define one).<\/p>\n<p>The images also define the required parameters that this method needs to perform the appropriate action without throwing errors. In this case, I need to provide the <b>INTPTR<\/b> and the <b>MARGINS<\/b> Struct that I defined earlier. Because I am using the same .dll for both methods, I will begin constructing the next method by using the same type already defined.<\/p>\n<p style=\"margin-left:30px\">#region DwmIsCompositionEnabled Method<\/p>\n<p style=\"margin-left:30px\">$PInvokeMethod = $TypeBuilder.DefineMethod(<\/p>\n<p style=\"margin-left:30px\">&nbsp;&nbsp;&nbsp; &#039;DwmIsCompositionEnabled&#039;, #Method Name<\/p>\n<p style=\"margin-left:30px\">&nbsp; &nbsp;&nbsp;[Reflection.MethodAttributes] &#039;PrivateScope, Public, Static, HideBySig, PinvokeImpl&#039;, #Method Attributes<\/p>\n<p style=\"margin-left:30px\">&nbsp;&nbsp;&nbsp; [Bool], #Method Return Type<\/p>\n<p style=\"margin-left:30px\">&nbsp;&nbsp;&nbsp; $Null #Method Parameters<\/p>\n<p style=\"margin-left:30px\">)<\/p>\n<p>&nbsp;<\/p>\n<p style=\"margin-left:30px\">$DllImportConstructor = [Runtime.InteropServices.DllImportAttribute].GetConstructor(@([String]))<\/p>\n<p style=\"margin-left:30px\">$FieldArray = [Reflection.FieldInfo[]] @(<\/p>\n<p style=\"margin-left:30px\">&nbsp;&nbsp;&nbsp; [Runtime.InteropServices.DllImportAttribute].GetField(&#039;EntryPoint&#039;),<\/p>\n<p style=\"margin-left:30px\">&nbsp;&nbsp;&nbsp; [Runtime.InteropServices.DllImportAttribute].GetField(&#039;PreserveSig&#039;)<\/p>\n<p style=\"margin-left:30px\">)<\/p>\n<p>&nbsp;<\/p>\n<p style=\"margin-left:30px\">$FieldValueArray = [Object[]] @(<\/p>\n<p style=\"margin-left:30px\">&nbsp;&nbsp;&nbsp; &#039;DwmIsCompositionEnabled&#039;, #CASE SENSITIVE!!<\/p>\n<p style=\"margin-left:30px\">&nbsp;&nbsp;&nbsp; $False<\/p>\n<p style=\"margin-left:30px\">)<\/p>\n<p>&nbsp;<\/p>\n<p style=\"margin-left:30px\">$CustomAttributeBuilder = New-Object Reflection.Emit.CustomAttributeBuilder(<\/p>\n<p style=\"margin-left:30px\">&nbsp;&nbsp;&nbsp; $DllImportConstructor,<\/p>\n<p style=\"margin-left:30px\">&nbsp;&nbsp;&nbsp; @(&#039;dwmapi.dll&#039;),<\/p>\n<p style=\"margin-left:30px\">&nbsp;&nbsp;&nbsp; $FieldArray,<\/p>\n<p style=\"margin-left:30px\">&nbsp;&nbsp;&nbsp; $FieldValueArray<\/p>\n<p style=\"margin-left:30px\">)<\/p>\n<p>&nbsp;<\/p>\n<p style=\"margin-left:30px\">$PInvokeMethod.SetCustomAttribute($CustomAttributeBuilder)<\/p>\n<p style=\"margin-left:30px\">#endregion DwmIsCompositionEnabled Method<\/p>\n<p>This is the same as what I did before. I am defining the next method (<b>DwmIsCompositionEnabled<\/b>) and supplying the proper return type. In this case, no parameters are required, so I leave that alone.<\/p>\n<p>With my two methods defined in the type, the next step is to finish creating the type and load it into the Windows PowerShell console.<\/p>\n<p style=\"margin-left:30px\">[void]$TypeBuilder.CreateType()<\/p>\n<p style=\"margin-left:30px\">#endregion DllImport<\/p>\n<p>So did this actually work? Let&rsquo;s take a look at the type and the available methods:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/GlassyPowerShell3.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/GlassyPowerShell3.png\" alt=\"Image of command output\" title=\"Image of command output\" \/><\/a><\/p>\n<p>As expected, not only has the type been created and is working, the methods that I defined are also available with the proper parameters required.<\/p>\n<p>All that is left is to run a little more code to create the <b>MARGINS<\/b> object and apply it to my Windows PowerShell console:<\/p>\n<p style=\"margin-left:30px\"># Desktop Window Manager (DWM) is always enabled in Windows 8<\/p>\n<p style=\"margin-left:30px\"># Calling DwmIsCompsitionEnabled() only applies if running Vista or Windows 7<\/p>\n<p style=\"margin-left:30px\">If ([Aero]::DwmIsCompositionEnabled()) {<\/p>\n<p style=\"margin-left:30px\">&nbsp;&nbsp;&nbsp; $hwnd = (Get-Process -Id $PID).mainwindowhandle<\/p>\n<p style=\"margin-left:30px\">&nbsp;&nbsp;&nbsp; $margin = New-Object &#039;MARGINS&#039;<\/p>\n<p>&nbsp;<\/p>\n<p style=\"margin-left:30px\">&nbsp;&nbsp;&nbsp; Switch ($PSCmdlet.ParameterSetName) {<\/p>\n<p style=\"margin-left:30px\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#039;Enable&#039; {<\/p>\n<p style=\"margin-left:30px\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Negative values create the &#039;glass&#039; effect<\/p>\n<p style=\"margin-left:30px\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $margin.top = -1<\/p>\n<p style=\"margin-left:30px\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $margin.left = -1&nbsp;&nbsp;&nbsp;&nbsp;<\/p>\n<p style=\"margin-left:30px\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $margin.right = -1&nbsp;&nbsp;&nbsp;<\/p>\n<p style=\"margin-left:30px\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $margin.bottom = -1&nbsp;&nbsp;&nbsp;<\/p>\n<p style=\"margin-left:30px\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $host.ui.RawUI.BackgroundColor = &quot;black&quot;<\/p>\n<p style=\"margin-left:30px\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $host.ui.rawui.Foregroundcolor = &quot;white&quot;&nbsp;&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p style=\"margin-left:30px\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Clear-Host<\/p>\n<p style=\"margin-left:30px\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<\/p>\n<p style=\"margin-left:30px\">&nbsp;&nbsp;&nbsp; }<\/p>\n<p style=\"margin-left:30px\">&nbsp;&nbsp;&nbsp; [Aero]::DwmExtendFrameIntoClientArea($hwnd, $margin)<\/p>\n<p style=\"margin-left:30px\">} Else {<\/p>\n<p style=\"margin-left:30px\">&nbsp;&nbsp;&nbsp; Write-Warning &quot;Aero is either not available or not enabled on this workstation.&quot;<\/p>\n<p style=\"margin-left:30px\">}<\/p>\n<p>The end result is that your Windows PowerShell console will have a more glassy look to it:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/GlassyPowerShell4.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/GlassyPowerShell4.png\" alt=\"Image of console\" title=\"Image of console\" \/><\/a><\/p>\n<p><span style=\"font-size:12px\">I prefer a black background because I feel that it gives the glassiest look of all of the background colors. But if you want to try some of the other colors, by all means give it a shot! Just keep in mind that you need to use <\/span><b style=\"font-size:12px\">Clear-Host<\/b><span style=\"font-size:12px\"> to clear the screen to apply the new color. Also ensure that a foreground color is not too similar in color, which can prevent being able to view the text.<\/span><\/p>\n<p>To change this back to the normal Windows PowerShell console, simply revert the <b>MARGINS<\/b> values to 0 and rerun the method:<\/p>\n<p style=\"margin-left:30px\">$margin.top = 0<\/p>\n<p style=\"margin-left:30px\">$margin.left = 0&nbsp;&nbsp;&nbsp;&nbsp;<\/p>\n<p style=\"margin-left:30px\">$margin.right = 0&nbsp;&nbsp;&nbsp;<\/p>\n<p style=\"margin-left:30px\">$margin.bottom = 0&nbsp;<\/p>\n<p style=\"margin-left:30px\">[Aero]::DwmExtendFrameIntoClientArea($hwnd, $margin)<\/p>\n<p>I also wrote a function that does all of this for you, and it is available on the Script Center Repository: <a href=\"http:\/\/gallery.technet.microsoft.com\/scriptcenter\/PowerShell-Glass-Console-d025fe3b\" target=\"_blank\">Enable Glass Console Theme<\/a>. You can enable or disable the Aero glass theme:<\/p>\n<p style=\"margin-left:30px\">Set-AeroGlass -Enable<\/p>\n<p style=\"margin-left:30px\">Set-AeroGlass -Disable<\/p>\n<p>That is all there is to working with the Win32 API and using Reflection to give your Windows PowerShell console a glassy theme.<\/p>\n<p>I invite you to follow the Scripting Guy on <a href=\"http:\/\/bit.ly\/scriptingguystwitter\" target=\"_blank\">Twitter<\/a> and <a href=\"http:\/\/bit.ly\/scriptingguysfacebook\" target=\"_blank\">Facebook<\/a>. If you have any questions, send email to the Scripting Guy at <a href=\"mailto:scripter@microsoft.com\" target=\"_blank\">scripter@microsoft.com<\/a>, or post your questions on the <a href=\"http:\/\/bit.ly\/scriptingforum\" target=\"_blank\">Official Scripting Guys Forum<\/a>.<\/p>\n<p><b>Boe Prox, <\/b>Windows PowerShell MVP and Honorary Scripting Guy<span style=\"font-size:12px\">&nbsp;<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Summary: Boe Prox shows how to give the Windows PowerShell console a glass-like look. Honorary Scripting Guy, Boe Prox, here today filling in for my good friend, The Scripting Guy. Have you ever sat at your desk while working in the Windows PowerShell console and thought, &ldquo;Wouldn&rsquo;t it be great if this console had a [&hellip;]<\/p>\n","protected":false},"author":596,"featured_media":87096,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[162,56,538,3,61,539,45],"class_list":["post-586","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-scripting","tag-boe-prox","tag-guest-blogger","tag-pinvoke","tag-scripting-guy","tag-weekend-scripter","tag-win32","tag-windows-powershell"],"acf":[],"blog_post_summary":"<p>Summary: Boe Prox shows how to give the Windows PowerShell console a glass-like look. Honorary Scripting Guy, Boe Prox, here today filling in for my good friend, The Scripting Guy. Have you ever sat at your desk while working in the Windows PowerShell console and thought, &ldquo;Wouldn&rsquo;t it be great if this console had a [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/586","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/users\/596"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/comments?post=586"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/586\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/media\/87096"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/media?parent=586"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/categories?post=586"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/tags?post=586"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}