{"id":1143,"date":"2011-02-15T10:05:30","date_gmt":"2011-02-15T15:05:30","guid":{"rendered":"http:\/\/jdhitsolutions.com\/blog\/?p=1143"},"modified":"2011-02-15T10:05:30","modified_gmt":"2011-02-15T15:05:30","slug":"set-file-encoding","status":"publish","type":"post","link":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1143\/set-file-encoding\/","title":{"rendered":"Set File Encoding"},"content":{"rendered":"<p>For most people, when you create a script in PowerShell you generally don't worry too much about how it is encoded. Most everything you encounter in PowerShell uses Unicode files. But when sharing files sometimes this causes problems. For example, when I post a script for download here, I need to make sure it is encoded using ASCII, otherwise formatting can get a little borked. I've also run into issues with editing the same file among different editors. Often what I need is a way to set the encoding. The manual way would be to use Notepad and select an appropriate encoding when using Save As.  But that doesn't scale. What I need is a way to take a group of files and set encoding. Here's my PowerShell solution.<!--more--><br \/>\nWhen I first tackled this problem I thought I was going to have to deal with arcane .NET classes. Then I remembered that Out-File has a parameter to specify encoding. All I had to do was take the content of the original file and send it to the same file with the appropriate encoding.<br \/>\nTechnically, Out-File is creating a new file but I wanted to keep the same name. The easiest solution was to get the contents of the current file and same them to a variable. Then use that as the input for Out-File.<br \/>\n[cc lang=\"PowerShell\"]<br \/>\n        $content=Get-Content -Path $file<br \/>\n        $filedata=Get-Item -Path $file<br \/>\n        Write-Verbose \"$(Get-Date) Saving content\"<br \/>\n        Out-File -FilePath $file -Encoding $Encoding -InputObject $content<br \/>\n[\/cc]<br \/>\nOne drawback, at least for me, is that results in a new file which means it has a new time stamp. Most of the time I want to leave this data alone so my Set-FileEncoding function has a parameter called -SaveTime that will take the time stamp values from the original file and copy them to the \"new\" file.<br \/>\n[cc lang=\"PowerShell\"]<br \/>\nif ($SaveTime)<br \/>\n        {<br \/>\n             #get the \"new\" file<br \/>\n             $f=Get-Item -Path $file<br \/>\n             Write-Verbose \"$(Get-Date) Retaining original time stamp values\"<br \/>\n              if ($pscmdlet.ShouldProcess(\"Resetting Timestamp on $file\"))<br \/>\n              {<br \/>\n                 #revert timestamp values<br \/>\n                 $f.CreationTime=$filedata.CreationTime<br \/>\n                 $f.CreationTimeUtc=$filedata.CreationTimeUtc<br \/>\n                 $f.LastAccessTime= $filedata.LastAccessTime<br \/>\n                 $f.LastAccessTimeUtc=$filedata.LastAccessTimeUtc<br \/>\n                 $f.LastWriteTime=$filedata.LastWriteTime<br \/>\n                 $f.LastWriteTimeUtc=$filedata.LastWriteTimeUtc<br \/>\n             }<br \/>\n        }<br \/>\n[\/cc]<br \/>\nThe end result is that I have a \"new\" copy of my file but with new encoding. Here's my function with the comment based help omitted.<br \/>\n[cc lang=\"PowerShell\"]<br \/>\nFunction Set-FileEncoding {<br \/>\n[cmdletBinding(SupportsShouldProcess=$True)]<\/p>\n<p>Param (<br \/>\n    [Parameter(Position=0,Mandatory=$True,HelpMessage=\"Enter a file name and <\/p>\n<p>path.\",<br \/>\n    ValueFromPipeline=$True,ValueFromPipelineByPropertyName=$True)]<br \/>\n    [ValidateNotNullorEmpty()]<br \/>\n    [Alias(\"PSPath\",\"Name\")]<br \/>\n    [string[]]$Path,<\/p>\n<p>    [ValidateSet(\"Unicode\", \"UTF7\", \"UTF8\", \"UTF32\", <\/p>\n<p>\"ASCII\",\"BigEndianUnicode\", \"Default\",\"OEM\")]<br \/>\n    [string]$Encoding=\"ASCII\",<\/p>\n<p>    [switch]$SaveTime,<\/p>\n<p>    [switch]$Passthru<br \/>\n)<\/p>\n<p>Begin<br \/>\n{<br \/>\n    Write-Verbose \"$(Get-Date) Starting $($myinvocation.command)\"<br \/>\n}<\/p>\n<p>Process<br \/>\n{<br \/>\n    foreach ($file in $path)<br \/>\n    {<br \/>\n        Write-Verbose \"$(Get-Date) Setting encoding on $File to $Encoding\"<br \/>\n        Write-Verbose \"$(Get-Date) Getting content\"<br \/>\n        $content=Get-Content -Path $file<br \/>\n        $filedata=Get-Item -Path $file<br \/>\n        Write-Verbose \"$(Get-Date) Saving content\"<br \/>\n        Out-File -FilePath $file -Encoding $Encoding -InputObject $content<\/p>\n<p>        if ($SaveTime)<br \/>\n        {<br \/>\n             #get the \"new\" file<br \/>\n             $f=Get-Item -Path $file<br \/>\n             Write-Verbose \"$(Get-Date) Retaining original time stamp values\"<br \/>\n              if ($pscmdlet.ShouldProcess(\"Resetting Timestamp on $file\"))<br \/>\n              {<br \/>\n                 #revert timestamp values<br \/>\n                 $f.CreationTime=$filedata.CreationTime<br \/>\n                 $f.CreationTimeUtc=$filedata.CreationTimeUtc<br \/>\n                 $f.LastAccessTime= $filedata.LastAccessTime<br \/>\n                 $f.LastAccessTimeUtc=$filedata.LastAccessTimeUtc<br \/>\n                 $f.LastWriteTime=$filedata.LastWriteTime<br \/>\n                 $f.LastWriteTimeUtc=$filedata.LastWriteTimeUtc<br \/>\n             }<br \/>\n        }<br \/>\n        if ($PassThru)<br \/>\n        {<br \/>\n            Get-Item -Path $file<br \/>\n        }<\/p>\n<p>     } #foreach<br \/>\n} #process<\/p>\n<p>End<br \/>\n{<br \/>\n    Write-Verbose \"$(Get-Date) Ending $($myinvocation.command)\"<br \/>\n}<\/p>\n<p>} #end function<br \/>\n[\/cc]<br \/>\nThe default encoding is set to ASCII but you can specify any encoding supported by Out-File. The function does not write anything to the pipeline. But you can use -Passthru and then the function will write the file object to the pipeline. Here are some examples:<br \/>\n[cc lang=\"PowerShell\"]<br \/>\nPS C:\\> Set-FileEncoding c:\\files\\data.txt -encoding Unicode<br \/>\nPS C:\\> dir c:\\scripts\\*.ps1 | set-fileencoding -savetime<br \/>\n[\/cc]<br \/>\nI hope it goes with out saying but don't try to use this with anything other than text files. Otherwise you will end up with corrupt files. If you can open the file and read it in Notepad then it should be fine.<\/p>\n<p>Download <a href='http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/02\/Set-FileEncoding.txt' target='_blank'>Set-FileEncoding.ps1<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>For most people, when you create a script in PowerShell you generally don&#8217;t worry too much about how it is encoded. Most everything you encounter in PowerShell uses Unicode files. But when sharing files sometimes this causes problems. For example, when I post a script for download here, I need to make sure it is&#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":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[4,8],"tags":[252,241,534],"class_list":["post-1143","post","type-post","status-publish","format-standard","hentry","category-powershell","category-scripting","tag-encoding","tag-out-file","tag-powershell"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Set File Encoding &#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\/1143\/set-file-encoding\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Set File Encoding &#8226; The Lonely Administrator\" \/>\n<meta property=\"og:description\" content=\"For most people, when you create a script in PowerShell you generally don&#039;t worry too much about how it is encoded. Most everything you encounter in PowerShell uses Unicode files. But when sharing files sometimes this causes problems. For example, when I post a script for download here, I need to make sure it is...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jdhitsolutions.com\/blog\/powershell\/1143\/set-file-encoding\/\" \/>\n<meta property=\"og:site_name\" content=\"The Lonely Administrator\" \/>\n<meta property=\"article:published_time\" content=\"2011-02-15T15:05:30+00:00\" \/>\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=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1143\\\/set-file-encoding\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1143\\\/set-file-encoding\\\/\"},\"author\":{\"name\":\"Jeffery Hicks\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"headline\":\"Set File Encoding\",\"datePublished\":\"2011-02-15T15:05:30+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1143\\\/set-file-encoding\\\/\"},\"wordCount\":664,\"commentCount\":5,\"publisher\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"keywords\":[\"Encoding\",\"Out-File\",\"PowerShell\"],\"articleSection\":[\"PowerShell\",\"Scripting\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1143\\\/set-file-encoding\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1143\\\/set-file-encoding\\\/\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1143\\\/set-file-encoding\\\/\",\"name\":\"Set File Encoding &#8226; The Lonely Administrator\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#website\"},\"datePublished\":\"2011-02-15T15:05:30+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1143\\\/set-file-encoding\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1143\\\/set-file-encoding\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/1143\\\/set-file-encoding\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"PowerShell\",\"item\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/category\\\/powershell\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Set File Encoding\"}]},{\"@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":"Set File Encoding &#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\/1143\/set-file-encoding\/","og_locale":"en_US","og_type":"article","og_title":"Set File Encoding &#8226; The Lonely Administrator","og_description":"For most people, when you create a script in PowerShell you generally don't worry too much about how it is encoded. Most everything you encounter in PowerShell uses Unicode files. But when sharing files sometimes this causes problems. For example, when I post a script for download here, I need to make sure it is...","og_url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1143\/set-file-encoding\/","og_site_name":"The Lonely Administrator","article_published_time":"2011-02-15T15:05:30+00:00","author":"Jeffery Hicks","twitter_card":"summary_large_image","twitter_creator":"@JeffHicks","twitter_site":"@JeffHicks","twitter_misc":{"Written by":"Jeffery Hicks","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1143\/set-file-encoding\/#article","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1143\/set-file-encoding\/"},"author":{"name":"Jeffery Hicks","@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"headline":"Set File Encoding","datePublished":"2011-02-15T15:05:30+00:00","mainEntityOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1143\/set-file-encoding\/"},"wordCount":664,"commentCount":5,"publisher":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"keywords":["Encoding","Out-File","PowerShell"],"articleSection":["PowerShell","Scripting"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/1143\/set-file-encoding\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1143\/set-file-encoding\/","url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1143\/set-file-encoding\/","name":"Set File Encoding &#8226; The Lonely Administrator","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#website"},"datePublished":"2011-02-15T15:05:30+00:00","breadcrumb":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1143\/set-file-encoding\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/1143\/set-file-encoding\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1143\/set-file-encoding\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"PowerShell","item":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},{"@type":"ListItem","position":2,"name":"Set File Encoding"}]},{"@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":1584,"url":"https:\/\/jdhitsolutions.com\/blog\/scripting\/1584\/friday-fun-add-scripting-signing-to-the-ise\/","url_meta":{"origin":1143,"position":0},"title":"Friday Fun Add Scripting Signing to the ISE","author":"Jeffery Hicks","date":"August 5, 2011","format":false,"excerpt":"Today's fun involves adding a menu item to the PowerShell ISE to make it easy to sign your scripts. I'm not going to go into the details about getting and installing a code signing certificate. I also assume you only have one installed. You can get this certificate by seasrching\u2026","rel":"","context":"In &quot;PowerShell ISE&quot;","block_context":{"text":"PowerShell ISE","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell-ise\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":634,"url":"https:\/\/jdhitsolutions.com\/blog\/best-practices\/634\/content-redirection\/","url_meta":{"origin":1143,"position":1},"title":"Content Redirection","author":"Jeffery Hicks","date":"May 3, 2010","format":false,"excerpt":"Here\u2019s another item I see in some submisstions of the 2010 Scripting Games that I felt I should address: the use of legacy console redirection. While technically not illegal or wrong, an example like this demonstrates (at least in my opinion) that the scripter hasn\u2019t fully adopted the PowerShell paradigm.\u2026","rel":"","context":"In &quot;Best Practices&quot;","block_context":{"text":"Best Practices","link":"https:\/\/jdhitsolutions.com\/blog\/category\/best-practices\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1156,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1156\/powershell-ise-most-recent-files\/","url_meta":{"origin":1143,"position":2},"title":"PowerShell ISE Most Recent Files","author":"Jeffery Hicks","date":"February 21, 2011","format":false,"excerpt":"The PowerShell ISE is a handy tool for editing and testing your scripts, functions and modules. If you can't afford a good commercial editor then you should at least be using the ISE. One benefit of the ISE is that it has its own object model which means it is\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\/2011\/02\/isemenu-300x198.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":4011,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4011\/friday-fun-a-popup-alternative\/","url_meta":{"origin":1143,"position":3},"title":"Friday Fun &#8211; A Popup Alternative","author":"Jeffery Hicks","date":"September 12, 2014","format":false,"excerpt":"In the past I've written and presented about different ways to add graphical elements to your PowerShell scripts that don't rely on Windows Forms or WPF. There's nothing wrong with those techniques, but they certainly require some expertise and depending on your situation may be overkill. So let's have some\u2026","rel":"","context":"In &quot;Friday Fun&quot;","block_context":{"text":"Friday Fun","link":"https:\/\/jdhitsolutions.com\/blog\/category\/friday-fun\/"},"img":{"alt_text":"windowpane-thumbnail","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2014\/09\/windowpane-thumbnail.jpg?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":1046,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1046\/convert-history-to-script\/","url_meta":{"origin":1143,"position":4},"title":"Convert History to Script","author":"Jeffery Hicks","date":"January 12, 2011","format":false,"excerpt":"Whenever I teach or speak about PowerShell, a recurring mantra is that there is no difference between running a PowerShell script and executing commands interactively in the shell, except that it saves you typing. You can create a PowerShell script by simply copying and pasting commands from the shell into\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1369,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1369\/scripting-games-2001-beginner-event-5-commentary\/","url_meta":{"origin":1143,"position":5},"title":"Scripting Games 2011 Beginner Event 5 Commentary","author":"Jeffery Hicks","date":"April 25, 2011","format":false,"excerpt":"My commentary for Beginner Event 5 in the 2011 Scripting Games is now available. One item that seems to be missing on the ScriptingGuys site is my complete solution so I thought I would share it here, plus a variation. My sample solution is perhaps a little over-wrought for a\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/1143","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=1143"}],"version-history":[{"count":0,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/1143\/revisions"}],"wp:attachment":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=1143"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=1143"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=1143"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}