{"id":4268,"date":"2015-03-06T08:41:13","date_gmt":"2015-03-06T13:41:13","guid":{"rendered":"http:\/\/jdhitsolutions.com\/blog\/?p=4268"},"modified":"2015-03-06T08:46:37","modified_gmt":"2015-03-06T13:46:37","slug":"friday-fun-size-me-up","status":"publish","type":"post","link":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4268\/friday-fun-size-me-up\/","title":{"rendered":"Friday Fun: Size Me Up"},"content":{"rendered":"<p>Part of day job involves creating training material, often in the form of video training for <a href=\"http:\/\/www.pluralsight.com\/author\/jeff-hicks\" target=\"_blank\">Pluralsight<\/a> or articles for <a href=\"http:\/\/www.petri.com\/author\/jeff-hicks\" target=\"_blank\">Petri.com<\/a>. Since I usually am covering PowerShell I often need to capture a PowerShell session. And sometimes I want the screen to be a particular size. So over time I've created a few PowerShell tools to resize console and application windows. The PowerShell console window stores its dimension under $host.ui.rawui.windowsize.<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2015\/03\/030615_1341_FridayFunSi1.png\" alt=\"\" \/><\/p>\n<p>These are the same settings you would see here:<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2015\/03\/030615_1341_FridayFunSi2.png\" alt=\"\" \/><\/p>\n<p>As long as you use a value less than the buffer dimensions, you can modify the console window from a prompt. But it takes a step you might not realize. You can't do this:<\/p>\n<pre><code>$host.ui.rawui.WindowSize.Height = 40<\/code><\/pre>\n<p>Instead, you can create a new type of object with your intended dimensions.<\/p>\n<pre><code>$size = New-Object System.Management.Automation.Host.Size(100,25)<\/code><\/pre>\n<p>Then you can use this object as a value for the WindowSize property.<\/p>\n<pre><code>$host.ui.rawui.WindowSize = $size<\/code><\/pre>\n<p><img decoding=\"async\" src=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2015\/03\/030615_1341_FridayFunSi3.png\" alt=\"\" \/><\/p>\n<p>Naturally, I created a function to do this for me.<\/p>\n<pre class=\"lang:ps decode:true \" >#requires -version 3.0\r\n\r\n#not for the ISE\r\n\r\nFunction Set-ConsoleWindowSize {\r\n[cmdletbinding(SupportsShouldProcess)]\r\n\r\nParam(\r\n[Alias(\"x\")]\r\n[ValidateScript({$_ -ge 10 -AND $_ -le $host.ui.rawui.buffersize.width})]\r\n[int]$Width = $host.ui.rawui.windowsize.width,\r\n\r\n[Alias(\"y\")]\r\n[ValidateScript({$_ -ge 10 -AND $_ -le $host.ui.rawui.buffersize.height})]\r\n[int]$Height = $host.ui.rawui.windowsize.height\r\n)\r\n\r\n    write-verbose \"Setting dimensions to $width x $height\"  \r\n    $size = New-Object System.Management.Automation.Host.Size($Width,$Height)\r\n    \r\n    #WhatIf code\r\n    if ($PSCmdlet.ShouldProcess(\"$width by $height\")) {\r\n        $host.ui.rawui.WindowSize = $size\r\n    }\r\n}<\/pre>\n<p>My function also includes code to support \u2013WhatIf.<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2015\/03\/030615_1341_FridayFunSi4.png\" alt=\"\" \/><\/p>\n<p>Of course now that I've shown you that I have an alternative. You can use the .NET class [System.Console] which has properties for width and height. And you can set these values independently.<\/p>\n<pre><code>[system.console]::WindowHeight = 20<\/code><\/pre>\n<p><img decoding=\"async\" src=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2015\/03\/030615_1341_FridayFunSi5.png\" alt=\"\" \/><\/p>\n<p>You can't discover this unless you know something of the .NET Framework, but you could have discovered $host which is why I showed you that first. Since I often need to record video at 1280x720 dimensions, I wrote a quick and dirty script to set my PowerShell console window to those dimensions.<\/p>\n<pre class=\"lang:ps decode:true \" >#requires -version 3.0\r\n\r\n#set PowerShell console to 1280x720\r\n#This is NOT for the ISE\r\n\r\n[cmdletbinding(SupportsShouldProcess)]\r\nParam()\r\n\r\n$h = 33\r\n$w = 103\r\n\r\nWrite-Verbose \"Setting Height to $h\"\r\nWrite-Verbose \"Setting Width to $w\"\r\n\r\nif ($PSCmdlet.shouldProcess(\"current session\")) {\r\n    [system.console]::WindowHeight = $h\r\n    [system.console]::WindowWidth = $w\r\n}<\/pre>\n<p><img decoding=\"async\" src=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2015\/03\/030615_1341_FridayFunSi6.png\" alt=\"\" \/><\/p>\n<p>Everything I've shown you so far is for the PowerShell console. But what about the ISE? You can't use the techniques I've covered. Application windows are bit more complicated and I'm not going to go into the details. But I came across some code on GitHub (<a href=\"https:\/\/gist.github.com\/coldnebo\/1148334\" target=\"_blank\">https:\/\/gist.github.com\/coldnebo\/1148334<\/a>). I don't do Minecraft but it didn't take much to turn it into a re-usable function.<\/p>\n<pre class=\"lang:ps decode:true \" >#requires -version 3.0\r\n\r\n#from https:\/\/gist.github.com\/coldnebo\/1148334\r\n\r\nFunction Set-WindowSize {\r\n\r\n[cmdletbinding(SupportsShouldProcess)]\r\nParam(\r\n[Parameter(Position=0,HelpMessage=\"What is the MainWindowHandle?\",\r\nValueFromPipeline,ValueFromPipelineByPropertyName)]\r\n[ValidateNotNullorEmpty()]\r\n[Alias(\"handle\")]\r\n[System.IntPtr]$MainWindowHandle = (Get-Process -id $pid).MainWindowHandle,\r\n[Alias(\"x\")]\r\n[int]$Width = 1280,\r\n[Alias(\"y\")]\r\n[int]$Height = 720\r\n\r\n)\r\n\r\nBegin {\r\n    Write-Verbose \"Starting $($MyInvocation.Mycommand)\" \r\n    \r\n    Write-Verbose \"Adding type\"\r\n\r\nAdd-Type @\"\r\n  using System;\r\n  using System.Runtime.InteropServices;\r\n \r\n  public class Win32 {\r\n    [DllImport(\"user32.dll\")]\r\n    [return: MarshalAs(UnmanagedType.Bool)]\r\n    public static extern bool GetWindowRect(IntPtr hWnd, out RECT lpRect);\r\n \r\n    [DllImport(\"user32.dll\")]\r\n    [return: MarshalAs(UnmanagedType.Bool)]\r\n    public static extern bool GetClientRect(IntPtr hWnd, out RECT lpRect);\r\n \r\n    [DllImport(\"user32.dll\")]\r\n    [return: MarshalAs(UnmanagedType.Bool)]\r\n    public static extern bool MoveWindow(IntPtr hWnd, int X, int Y, int nWidth, int nHeight, bool bRepaint);\r\n  }\r\n \r\n  public struct RECT\r\n  {\r\n    public int Left;        \/\/ x position of upper-left corner\r\n    public int Top;         \/\/ y position of upper-left corner\r\n    public int Right;       \/\/ x position of lower-right corner\r\n    public int Bottom;      \/\/ y position of lower-right corner\r\n  }\r\n \r\n\"@\r\n  \r\n} #begin\r\n\r\nProcess {\r\n\r\n#verify handle and get process\r\n\r\nWrite-Verbose \"Verifying process with MainWindowHandle of $MainWindowhandle\"\r\n\r\n$proc = (Get-Process).where({$_.mainwindowhandle -eq $MainWindowhandle})\r\n\r\nif (-NOT $proc.mainwindowhandle) {\r\n    Write-Warning \"Failed to find a process with a MainWindowHandle of $MainWndowhandle\"\r\n    #bail out\r\n    Return\r\n}\r\n\r\nWrite-Verbose \"Creating rectangle objects\" \r\n$rcWindow = New-Object RECT\r\n$rcClient = New-Object RECT\r\n\r\nWrite-Verbose \"Getting current settings\"\r\n[Win32]::GetWindowRect($MainWindowHandle,[ref]$rcWindow) | Out-Null\r\n[Win32]::GetClientRect($MainWindowHandle,[ref]$rcClient) | Out-Null\r\n \r\nWrite-Verbose \"Setting new coordinates\"\r\n\r\n#WhatIf\r\nif ($PSCmdlet.ShouldProcess(\"$($proc.MainWindowTitle) to $width by $height\")) {\r\n    $dx = ($rcWindow.Right - $rcWindow.Left) - $rcClient.Right\r\n    $dy = ($rcWindow.Bottom - $rcWindow.Top) - $rcClient.Bottom\r\n\r\n    Write-Verbose \"Moving window\" \r\n    [Win32]::MoveWindow($MainWindowHandle, $rct.Left, $rct.Top, $width + $dx, $height + $dy, $true ) | out-null\r\n} #close Whatif\r\n\r\n\r\n} #process\r\n\r\nEnd {\r\n    Write-Verbose \"Ending $($MyInvocation.Mycommand)\"\r\n} #end\r\n\r\n} #end Set-WindowSize function<\/pre>\n<p>The code supports \u2013WhatIf and defaults to the current application, which is presumably the PowerShell ISE.<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2015\/03\/030615_1341_FridayFunSi7.png\" alt=\"\" \/><\/p>\n<p>But this is what actually gets set.<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2015\/03\/030615_1341_FridayFunSi8.png\" alt=\"\" \/><\/p>\n<p>So if you wanted to include the title bar you would need to adjust accordingly.<\/p>\n<p>All of this may not really be applicable to your work, but if you find a good use I hope you'll let me know. Have a great weekend.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Part of day job involves creating training material, often in the form of video training for Pluralsight or articles for Petri.com. Since I usually am covering PowerShell I often need to capture a PowerShell session. And sometimes I want the screen to be a particular size. So over time I&#8217;ve created a few PowerShell tools&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"New #PowerShell Friday Fun: Size Me Up","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[271,4],"tags":[176,568,224,534,540],"class_list":["post-4268","post","type-post","status-publish","format-standard","hentry","category-friday-fun","category-powershell","tag-console","tag-friday-fun","tag-function","tag-powershell","tag-scripting"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Friday Fun: Size Me Up &#8226; The Lonely Administrator<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/jdhitsolutions.com\/blog\/powershell\/4268\/friday-fun-size-me-up\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Friday Fun: Size Me Up &#8226; The Lonely Administrator\" \/>\n<meta property=\"og:description\" content=\"Part of day job involves creating training material, often in the form of video training for Pluralsight or articles for Petri.com. Since I usually am covering PowerShell I often need to capture a PowerShell session. And sometimes I want the screen to be a particular size. So over time I&#039;ve created a few PowerShell tools...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jdhitsolutions.com\/blog\/powershell\/4268\/friday-fun-size-me-up\/\" \/>\n<meta property=\"og:site_name\" content=\"The Lonely Administrator\" \/>\n<meta property=\"article:published_time\" content=\"2015-03-06T13:41:13+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2015-03-06T13:46:37+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2015\/03\/030615_1341_FridayFunSi1.png\" \/>\n<meta name=\"author\" content=\"Jeffery Hicks\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@JeffHicks\" \/>\n<meta name=\"twitter:site\" content=\"@JeffHicks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jeffery Hicks\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/4268\\\/friday-fun-size-me-up\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/4268\\\/friday-fun-size-me-up\\\/\"},\"author\":{\"name\":\"Jeffery Hicks\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"headline\":\"Friday Fun: Size Me Up\",\"datePublished\":\"2015-03-06T13:41:13+00:00\",\"dateModified\":\"2015-03-06T13:46:37+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/4268\\\/friday-fun-size-me-up\\\/\"},\"wordCount\":396,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"image\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/4268\\\/friday-fun-size-me-up\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2015\\\/03\\\/030615_1341_FridayFunSi1.png\",\"keywords\":[\"console\",\"Friday Fun\",\"Function\",\"PowerShell\",\"Scripting\"],\"articleSection\":[\"Friday Fun\",\"PowerShell\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/4268\\\/friday-fun-size-me-up\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/4268\\\/friday-fun-size-me-up\\\/\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/4268\\\/friday-fun-size-me-up\\\/\",\"name\":\"Friday Fun: Size Me Up &#8226; The Lonely Administrator\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/4268\\\/friday-fun-size-me-up\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/4268\\\/friday-fun-size-me-up\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2015\\\/03\\\/030615_1341_FridayFunSi1.png\",\"datePublished\":\"2015-03-06T13:41:13+00:00\",\"dateModified\":\"2015-03-06T13:46:37+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/4268\\\/friday-fun-size-me-up\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/4268\\\/friday-fun-size-me-up\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/4268\\\/friday-fun-size-me-up\\\/#primaryimage\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2015\\\/03\\\/030615_1341_FridayFunSi1.png\",\"contentUrl\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2015\\\/03\\\/030615_1341_FridayFunSi1.png\",\"width\":624,\"height\":136},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/4268\\\/friday-fun-size-me-up\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Friday Fun\",\"item\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/category\\\/friday-fun\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Friday Fun: Size Me Up\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/\",\"name\":\"The Lonely Administrator\",\"description\":\"Practical Advice for the Automating IT Pro\",\"publisher\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\",\"name\":\"Jeffery Hicks\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg\",\"caption\":\"Jeffery Hicks\"},\"logo\":{\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Friday Fun: Size Me Up &#8226; The Lonely Administrator","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4268\/friday-fun-size-me-up\/","og_locale":"en_US","og_type":"article","og_title":"Friday Fun: Size Me Up &#8226; The Lonely Administrator","og_description":"Part of day job involves creating training material, often in the form of video training for Pluralsight or articles for Petri.com. Since I usually am covering PowerShell I often need to capture a PowerShell session. And sometimes I want the screen to be a particular size. So over time I've created a few PowerShell tools...","og_url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4268\/friday-fun-size-me-up\/","og_site_name":"The Lonely Administrator","article_published_time":"2015-03-06T13:41:13+00:00","article_modified_time":"2015-03-06T13:46:37+00:00","og_image":[{"url":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2015\/03\/030615_1341_FridayFunSi1.png","type":"","width":"","height":""}],"author":"Jeffery Hicks","twitter_card":"summary_large_image","twitter_creator":"@JeffHicks","twitter_site":"@JeffHicks","twitter_misc":{"Written by":"Jeffery Hicks","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4268\/friday-fun-size-me-up\/#article","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4268\/friday-fun-size-me-up\/"},"author":{"name":"Jeffery Hicks","@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"headline":"Friday Fun: Size Me Up","datePublished":"2015-03-06T13:41:13+00:00","dateModified":"2015-03-06T13:46:37+00:00","mainEntityOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4268\/friday-fun-size-me-up\/"},"wordCount":396,"commentCount":1,"publisher":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"image":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4268\/friday-fun-size-me-up\/#primaryimage"},"thumbnailUrl":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2015\/03\/030615_1341_FridayFunSi1.png","keywords":["console","Friday Fun","Function","PowerShell","Scripting"],"articleSection":["Friday Fun","PowerShell"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/4268\/friday-fun-size-me-up\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4268\/friday-fun-size-me-up\/","url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4268\/friday-fun-size-me-up\/","name":"Friday Fun: Size Me Up &#8226; The Lonely Administrator","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4268\/friday-fun-size-me-up\/#primaryimage"},"image":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4268\/friday-fun-size-me-up\/#primaryimage"},"thumbnailUrl":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2015\/03\/030615_1341_FridayFunSi1.png","datePublished":"2015-03-06T13:41:13+00:00","dateModified":"2015-03-06T13:46:37+00:00","breadcrumb":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4268\/friday-fun-size-me-up\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/4268\/friday-fun-size-me-up\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4268\/friday-fun-size-me-up\/#primaryimage","url":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2015\/03\/030615_1341_FridayFunSi1.png","contentUrl":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2015\/03\/030615_1341_FridayFunSi1.png","width":624,"height":136},{"@type":"BreadcrumbList","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4268\/friday-fun-size-me-up\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Friday Fun","item":"https:\/\/jdhitsolutions.com\/blog\/category\/friday-fun\/"},{"@type":"ListItem","position":2,"name":"Friday Fun: Size Me Up"}]},{"@type":"WebSite","@id":"https:\/\/jdhitsolutions.com\/blog\/#website","url":"https:\/\/jdhitsolutions.com\/blog\/","name":"The Lonely Administrator","description":"Practical Advice for the Automating IT Pro","publisher":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/jdhitsolutions.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9","name":"Jeffery Hicks","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg","url":"https:\/\/secure.gravatar.com\/avatar\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg","caption":"Jeffery Hicks"},"logo":{"@id":"https:\/\/secure.gravatar.com\/avatar\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg"}}]}},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":6240,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/6240\/friday-fun-with-timely-powershell-prompts\/","url_meta":{"origin":4268,"position":0},"title":"Friday Fun with Timely PowerShell Prompts","author":"Jeffery Hicks","date":"November 30, 2018","format":false,"excerpt":"If PowerShell is a part of your daily routine, you most likely have a console window open all day. In addition to using PowerShell to get stuff done, you can use PowerShell to keep you on track. I've written before and talked about how I use PowerShell to manage my\u2026","rel":"","context":"In &quot;Friday Fun&quot;","block_context":{"text":"Friday Fun","link":"https:\/\/jdhitsolutions.com\/blog\/category\/friday-fun\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2018\/11\/image_thumb-13.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2018\/11\/image_thumb-13.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2018\/11\/image_thumb-13.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2018\/11\/image_thumb-13.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":4830,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4830\/friday-fun-a-powershell-nap\/","url_meta":{"origin":4268,"position":1},"title":"Friday Fun: A PowerShell Nap","author":"Jeffery Hicks","date":"January 22, 2016","format":false,"excerpt":"I'm hoping that I'm not the only one who feels their butt dragging by mid to late afternoon. Let's say that's because we've been thundering through the day and by 3:00 we're a bit out of gas. Yeah, I'll go with that. I find myself wanting to close my eyes\u2026","rel":"","context":"In &quot;Friday Fun&quot;","block_context":{"text":"Friday Fun","link":"https:\/\/jdhitsolutions.com\/blog\/category\/friday-fun\/"},"img":{"alt_text":"antique-watch-150x225","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2016\/01\/antique-watch-150x225_thumb.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":3912,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3912\/friday-fun-a-random-powershell-console\/","url_meta":{"origin":4268,"position":2},"title":"Friday Fun: A Random PowerShell Console","author":"Jeffery Hicks","date":"July 11, 2014","format":false,"excerpt":"This week I thought we'd have a little fun with the PowerShell console and maybe pick up a few scripting techniques along the way. Today I have a function that changes the foreground and background colors of your PowerShell console to random values. But because you might want to go\u2026","rel":"","context":"In &quot;Friday Fun&quot;","block_context":{"text":"Friday Fun","link":"https:\/\/jdhitsolutions.com\/blog\/category\/friday-fun\/"},"img":{"alt_text":"crayons","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/11\/crayons-150x150.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":4923,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell-ise\/4923\/friday-fun-tweaking-the-powershell-ise\/","url_meta":{"origin":4268,"position":3},"title":"Friday Fun: Tweaking the PowerShell ISE","author":"Jeffery Hicks","date":"February 19, 2016","format":false,"excerpt":"Today's fun is still PowerShell related, but instead of something in the console, we'll have some fun with the PowerShell ISE. One of the things I love about the PowerShell ISE is that you can customize it and extend it.\u00a0 My ISE Scripting Geek project is an example.\u00a0 But today\u2026","rel":"","context":"In &quot;Friday Fun&quot;","block_context":{"text":"Friday Fun","link":"https:\/\/jdhitsolutions.com\/blog\/category\/friday-fun\/"},"img":{"alt_text":"image","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2016\/02\/image_thumb-12.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":7149,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/7149\/friday-fun-taking-a-shortcut-path-in-your-powershell-prompt\/","url_meta":{"origin":4268,"position":4},"title":"Friday Fun: Taking a Shortcut Path in Your PowerShell Prompt","author":"Jeffery Hicks","date":"January 3, 2020","format":false,"excerpt":"To kick off the new year I thought I'd take a shortcut and reclaim some wasted space in my PowerShell prompt. I know I run into this issue during classes and conferences. Perhaps you encounter it as well. You are in in the PowerShell console and have ended up in\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/01\/image_thumb-3.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/01\/image_thumb-3.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/01\/image_thumb-3.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/01\/image_thumb-3.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":867,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/867\/friday-fun-music-of-the-shell\/","url_meta":{"origin":4268,"position":5},"title":"Friday Fun: Music of the Shell","author":"Jeffery Hicks","date":"August 27, 2010","format":false,"excerpt":"We made it to the end of the week, and I don't know about you but I have my head buried in PowerShell work. But you know what they say about all work and no fun...so I figured I'd take a break from serious PowerShell and do something a little\u2026","rel":"","context":"In &quot;Friday Fun&quot;","block_context":{"text":"Friday Fun","link":"https:\/\/jdhitsolutions.com\/blog\/category\/friday-fun\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/4268","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/comments?post=4268"}],"version-history":[{"count":0,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/4268\/revisions"}],"wp:attachment":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=4268"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=4268"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=4268"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}