{"id":8378,"date":"2021-05-06T11:00:32","date_gmt":"2021-05-06T15:00:32","guid":{"rendered":"https:\/\/jdhitsolutions.com\/blog\/?p=8378"},"modified":"2021-05-06T11:42:04","modified_gmt":"2021-05-06T15:42:04","slug":"powershell-tough-love","status":"publish","type":"post","link":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8378\/powershell-tough-love\/","title":{"rendered":"PowerShell Tough Love"},"content":{"rendered":"\n<div class=\"wp-block-image is-style-default\"><figure class=\"alignleft size-large is-resized\"><a href=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/05\/pexels-cottonbro-7670313.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/05\/pexels-cottonbro-7670313.jpg\" alt=\"\" class=\"wp-image-8379\" width=\"240\" height=\"160\" srcset=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/05\/pexels-cottonbro-7670313.jpg 320w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/05\/pexels-cottonbro-7670313-300x200.jpg 300w\" sizes=\"auto, (max-width: 240px) 100vw, 240px\" \/><\/a><\/figure><\/div>\n\n\n\n<p>The other day I was helping Gladys Kravitz on her transition to VS Code. Like many of you, she has been using the PowerShell ISE for years and has a deeply ingrained workflow. I'll be the first to admit that making the transition to VS Code is not easy. I remember when I made the transition. It was hard. But so was learning PowerShell. Jumping into VS Code is like learning anything new. You need constant exposure and repetition. Eventually, you'll build up new muscle memory and develop new work processes. Let me help you start today to break out of the ISE rut by showing a little PowerShell tough love. And yes, this is meant to be a bit tongue in cheek and a way to teach a few PowerShell concepts.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Kill the ISE<\/h2>\n\n\n\n<p>Gladys' big challenge, probably like many of you, is trying to break the habit of launching the PowerShell ISE. It doesn't matter if you are running the <em>ise <\/em>alias at a PowerShell prompt or using a Start Menu shortcut. My idea is that if you can't stop yourself from doing this, then why not have the ISE turn around and launch VS Code? I gave Gladys a few lines of code to put in her PowerShell ISE profile script that launched VS Code and then killed the ISE. I've since, refined that code and I thought I'd share it with everyone else.<\/p>\n\n\n\n<p>There are a few assumptions in the process. First, is that when you installed VS Code, you included the option to include the application in your %PATH%. You can test this. At a PowerShell prompt run <em>code<\/em>. If VS Code launches, you are ready to continue.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">ISE Profile Script<\/h2>\n\n\n\n<p>The PowerShell ISE is nothing more than a different PowerShell host. As such it has its own set of profile scripts. Open the PowerShell ISE and in the console, view your profiles.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-style-default\"><a href=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/05\/iseprofiles.png\"><img loading=\"lazy\" decoding=\"async\" width=\"875\" height=\"158\" src=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/05\/iseprofiles.png\" alt=\"\" class=\"wp-image-8380\" srcset=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/05\/iseprofiles.png 875w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/05\/iseprofiles-300x54.png 300w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/05\/iseprofiles-768x139.png 768w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/05\/iseprofiles-850x153.png 850w\" sizes=\"auto, (max-width: 875px) 100vw, 875px\" \/><\/a><\/figure>\n\n\n\n<p>You can see the scripts with ISE in the name. $Profile will be the script for the current user in the current host, or the ISE. If you have one, you can run <em>psedit $profile<\/em> to open it. Otherwise, create a new file:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"powershell\" class=\"language-powershell\">New-Item&nbsp;$profile&nbsp;-force&nbsp;-ItemType&nbsp;File<\/code><\/pre>\n\n\n\n<p>Then open the file in the ISE.  I'll give you code to add in a moment.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Profile Processing<\/h2>\n\n\n\n<p>My goal is to transition from the ISE to VSCode as quickly and as seamlessly as possible. As I was testing, I found the ISE taking a bit longer to get to the code I inserted. Then I remembered.  PowerShell looks for and processes PowerShell profile scripts starting from \"All Users All Hosts\" down to \"Current User Current Host\". In my case, and maybe yours, I am using a \"Current User Current Host\" profile script. This script is defining functions and PSDrives that I want to very regardless of whether I am using the PowerShell ISE or Windows PowerShell. PowerShell 7 is a different host so it has a different set of profile scripts.<\/p>\n\n\n\n<p>In the \"Current User Current Host\", I added an If statement.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"powershell\" class=\"language-powershell\">if ($host.name -notmatch \"ISE\") {\n . c:\\scripts\\jdh-functions.ps1\n . c:\\scripts\\jdh-aliases.ps1\n . c:\\scripts\\jdh-variables.ps1\n . c:\\scripts\\jdh-psdrives.ps1\n...\n}<\/code><\/pre>\n\n\n\n<p>Now when the ISE launches and processes this profile script, it won't do anything. I could also have gone this route.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"powershell\" class=\"language-powershell\">If ($host.name -match \"ISE\") {\n  Return\n }<\/code><\/pre>\n\n\n\n<p>Now for the tough love. At the beginning of the profile script for the PowerShell ISE, insert this code.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"powershell\" class=\"language-powershell\">$WindowState&nbsp;=&nbsp;Add-Type&nbsp;-MemberDefinition&nbsp;@'\n[DllImport(\"user32.dll\")]\npublic&nbsp;static&nbsp;extern&nbsp;bool&nbsp;ShowWindowAsync(IntPtr&nbsp;hWnd,&nbsp;int&nbsp;nCmdShow);\n'@&nbsp;-Name&nbsp;\"WindowState\"&nbsp;-Namespace&nbsp;Win32Functions&nbsp;-PassThru\n\n#get&nbsp;the&nbsp;current&nbsp;process\n$me&nbsp;=&nbsp;Get-Process&nbsp;-Id&nbsp;$pid\n\n#minimize&nbsp;the&nbsp;ISE\n$WindowState::ShowWindowAsync($me.MainWindowHandle,&nbsp;2)\n\n#see if a path was specified\n#split on arguments, trimming blank items\n $c = (Get-CimInstance -class win32_process -Filter \"processid = $pid\" -Property Commandline).Commandline.Split() | Where-object {$_}\n #Launch VSCode, assuming you added it to your path\n $cmd = Get-Command code.cmd\n if ($c.count -gt 1) {\n   #pass each file name to VSCode\n   $c[-1].split(\",\").foreach( { &amp;$cmd.source (Resolve-Path $_).Path })\n }\n else {\n   &amp;$cmd.source\n }\n\n#Gracefully&nbsp;close&nbsp;the&nbsp;ISE\n$me.CloseMainWindow()<\/code><\/pre>\n\n\n\n<p>Here's what happens. <\/p>\n\n\n\n<p>When I launch the PowerShell ISE, I want to pretend I didn't. So the first part of the code is creating a custom type built from a Win32API. This lets me minimize the PowerShell ISE window. While minimized, I use Get-CimInstance to get the PowerShell ISE process. This is because I want to check for any file names. If I run a command like<em> ise .\\get-it.ps1<\/em>, I want VSCode to also open .\\get-it.ps1. WMI gives me this information. If I'm launching multiple files, that will be detected as a comma separated string which I can split.<\/p>\n\n\n\n<p>If I use the ISE alias as I always have, I'll be good. But there is one gotcha. VS Code lets me open an entire folder:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"powershell\" class=\"language-powershell\">code c:\\scripts\\psfunctioninfo<\/code><\/pre>\n\n\n\n<p>But if I try the same thing using the ISE alias, I'll get an error. However, when I click OK to dismiss the error, VS Code will in fact open the folder. <\/p>\n\n\n\n<p>With this PowerShell ISE profile in place, no matter how I launch the ISE, VS Code will open and the ISE will close.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">But I REALLY Need the ISE<\/h2>\n\n\n\n<p>If for some reason you really want to get into the ISE once you've put this code in place, all you need to do is launch the ISE from a console prompt.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"powershell\" class=\"language-powershell\">ise -noprofile<\/code><\/pre>\n\n\n\n<p>But I hope, over time, you'll wean yourself off the PowerShell ISE as your editor of choice and move to VSCode. So if you've been struggling to break the habit, show a little tough love. Your future self will thank you.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The other day I was helping Gladys Kravitz on her transition to VS Code. Like many of you, she has been using the PowerShell ISE for years and has a deeply ingrained workflow. I&#8217;ll be the first to admit that making the transition to VS Code is not easy. I remember when I made the&#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 on the blog: #PowerShell Tough Love","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":[4,231,525],"tags":[534,567,84,526],"class_list":["post-8378","post","type-post","status-publish","format-standard","hentry","category-powershell","category-powershell-ise","category-vscode","tag-powershell","tag-powershell-ise","tag-profile","tag-vscode"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>PowerShell Tough Love &#8226; The Lonely Administrator<\/title>\n<meta name=\"description\" content=\"Need to make the change from the PowerShell ISE to VS Code but can&#039;t break the ISE habit? Show a little tough PowerShell love.\" \/>\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\/8378\/powershell-tough-love\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"PowerShell Tough Love &#8226; The Lonely Administrator\" \/>\n<meta property=\"og:description\" content=\"Need to make the change from the PowerShell ISE to VS Code but can&#039;t break the ISE habit? Show a little tough PowerShell love.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jdhitsolutions.com\/blog\/powershell\/8378\/powershell-tough-love\/\" \/>\n<meta property=\"og:site_name\" content=\"The Lonely Administrator\" \/>\n<meta property=\"article:published_time\" content=\"2021-05-06T15:00:32+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-05-06T15:42:04+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/05\/pexels-cottonbro-7670313.jpg\" \/>\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=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/8378\\\/powershell-tough-love\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/8378\\\/powershell-tough-love\\\/\"},\"author\":{\"name\":\"Jeffery Hicks\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"headline\":\"PowerShell Tough Love\",\"datePublished\":\"2021-05-06T15:00:32+00:00\",\"dateModified\":\"2021-05-06T15:42:04+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/8378\\\/powershell-tough-love\\\/\"},\"wordCount\":824,\"commentCount\":14,\"publisher\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"image\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/8378\\\/powershell-tough-love\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/05\\\/pexels-cottonbro-7670313.jpg\",\"keywords\":[\"PowerShell\",\"PowerShell ISE\",\"Profile\",\"VSCode\"],\"articleSection\":[\"PowerShell\",\"PowerShell ISE\",\"VSCode\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/8378\\\/powershell-tough-love\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/8378\\\/powershell-tough-love\\\/\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/8378\\\/powershell-tough-love\\\/\",\"name\":\"PowerShell Tough Love &#8226; The Lonely Administrator\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/8378\\\/powershell-tough-love\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/8378\\\/powershell-tough-love\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/05\\\/pexels-cottonbro-7670313.jpg\",\"datePublished\":\"2021-05-06T15:00:32+00:00\",\"dateModified\":\"2021-05-06T15:42:04+00:00\",\"description\":\"Need to make the change from the PowerShell ISE to VS Code but can't break the ISE habit? Show a little tough PowerShell love.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/8378\\\/powershell-tough-love\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/8378\\\/powershell-tough-love\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/8378\\\/powershell-tough-love\\\/#primaryimage\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/05\\\/pexels-cottonbro-7670313.jpg\",\"contentUrl\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/05\\\/pexels-cottonbro-7670313.jpg\",\"width\":320,\"height\":213},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/8378\\\/powershell-tough-love\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"PowerShell\",\"item\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/category\\\/powershell\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"PowerShell Tough Love\"}]},{\"@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":"PowerShell Tough Love &#8226; The Lonely Administrator","description":"Need to make the change from the PowerShell ISE to VS Code but can't break the ISE habit? Show a little tough PowerShell love.","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\/8378\/powershell-tough-love\/","og_locale":"en_US","og_type":"article","og_title":"PowerShell Tough Love &#8226; The Lonely Administrator","og_description":"Need to make the change from the PowerShell ISE to VS Code but can't break the ISE habit? Show a little tough PowerShell love.","og_url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8378\/powershell-tough-love\/","og_site_name":"The Lonely Administrator","article_published_time":"2021-05-06T15:00:32+00:00","article_modified_time":"2021-05-06T15:42:04+00:00","og_image":[{"url":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/05\/pexels-cottonbro-7670313.jpg","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":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8378\/powershell-tough-love\/#article","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8378\/powershell-tough-love\/"},"author":{"name":"Jeffery Hicks","@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"headline":"PowerShell Tough Love","datePublished":"2021-05-06T15:00:32+00:00","dateModified":"2021-05-06T15:42:04+00:00","mainEntityOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8378\/powershell-tough-love\/"},"wordCount":824,"commentCount":14,"publisher":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"image":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8378\/powershell-tough-love\/#primaryimage"},"thumbnailUrl":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/05\/pexels-cottonbro-7670313.jpg","keywords":["PowerShell","PowerShell ISE","Profile","VSCode"],"articleSection":["PowerShell","PowerShell ISE","VSCode"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/8378\/powershell-tough-love\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8378\/powershell-tough-love\/","url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8378\/powershell-tough-love\/","name":"PowerShell Tough Love &#8226; The Lonely Administrator","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8378\/powershell-tough-love\/#primaryimage"},"image":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8378\/powershell-tough-love\/#primaryimage"},"thumbnailUrl":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/05\/pexels-cottonbro-7670313.jpg","datePublished":"2021-05-06T15:00:32+00:00","dateModified":"2021-05-06T15:42:04+00:00","description":"Need to make the change from the PowerShell ISE to VS Code but can't break the ISE habit? Show a little tough PowerShell love.","breadcrumb":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8378\/powershell-tough-love\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/8378\/powershell-tough-love\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8378\/powershell-tough-love\/#primaryimage","url":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/05\/pexels-cottonbro-7670313.jpg","contentUrl":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/05\/pexels-cottonbro-7670313.jpg","width":320,"height":213},{"@type":"BreadcrumbList","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8378\/powershell-tough-love\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"PowerShell","item":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},{"@type":"ListItem","position":2,"name":"PowerShell Tough Love"}]},{"@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":5907,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/5907\/extending-vscode-with-powershell\/","url_meta":{"origin":8378,"position":0},"title":"Extending VSCode with PowerShell","author":"Jeffery Hicks","date":"March 2, 2018","format":false,"excerpt":"Last year I made a conscious decision to jump into VS Code as my primary PowerShell development tool. I had spent years tweaking and customizing the PowerShell ISE so I was a little concerned about the transition.\u00a0 But I knew the only way I'd master VS Code (and I still\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\/2018\/03\/image_thumb-3.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2018\/03\/image_thumb-3.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2018\/03\/image_thumb-3.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2018\/03\/image_thumb-3.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":5078,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/5078\/configuring-the-vscode-powershell-terminal\/","url_meta":{"origin":8378,"position":1},"title":"Configuring the VSCode PowerShell Terminal","author":"Jeffery Hicks","date":"June 9, 2016","format":false,"excerpt":"Yesterday I posted my experiences in setting up the latest build of VSCode on how to use a PowerShell terminal session. As I explained, in this particular session I didn't want to run any profile scripts. My reasoning was that this session obviously wasn't the ISE nor was I likely\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"VSCode PowerShell Session","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2016\/06\/image_thumb-8.png?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2016\/06\/image_thumb-8.png?resize=350%2C200 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2016\/06\/image_thumb-8.png?resize=525%2C300 1.5x"},"classes":[]},{"id":5073,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/5073\/powershell-sessions-and-vs-code\/","url_meta":{"origin":8378,"position":2},"title":"PowerShell Sessions and VS Code","author":"Jeffery Hicks","date":"June 8, 2016","format":false,"excerpt":"If you do any amount of PowerShell scripting you have most likely heard about Visual Studio Code. This is a free cross-platform light-weight editor from Microsoft. VS Code supports multiple languages and is extensible. I've tried different versions since it was first released but never found a reason to jump\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"image","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2016\/06\/image_thumb-5.png?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2016\/06\/image_thumb-5.png?resize=350%2C200 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2016\/06\/image_thumb-5.png?resize=525%2C300 1.5x"},"classes":[]},{"id":5499,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/5499\/more-fun-with-vscode-snippets\/","url_meta":{"origin":8378,"position":3},"title":"More Fun with VSCode Snippets","author":"Jeffery Hicks","date":"March 13, 2017","format":false,"excerpt":"A few days ago I posted an entry that explained how to create and use snippets in Visual Studio Code. As mentioned in that article I'm attempting to make the transition to VSCode for all my PowerShell work. Being able to use snippets is just one feature that I rely\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"image","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2017\/03\/image_thumb-10.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":5488,"url":"https:\/\/jdhitsolutions.com\/blog\/scripting\/5488\/adding-powershell-snippets-to-visual-studio-code\/","url_meta":{"origin":8378,"position":4},"title":"Adding PowerShell Snippets to Visual Studio Code","author":"Jeffery Hicks","date":"March 10, 2017","format":false,"excerpt":"So I've recently moved my daily work to a different laptop, a Yoga 900 with 16GB of RAM to be exact. I had been running Windows 8.1 but decided to jump in completely to a Windows 10 environment. As part of the process I've also made it a goal to\u2026","rel":"","context":"In &quot;Scripting&quot;","block_context":{"text":"Scripting","link":"https:\/\/jdhitsolutions.com\/blog\/category\/scripting\/"},"img":{"alt_text":"image","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2017\/03\/image_thumb.png?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2017\/03\/image_thumb.png?resize=350%2C200 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2017\/03\/image_thumb.png?resize=525%2C300 1.5x"},"classes":[]},{"id":7468,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/7468\/powershell-7-scripting-with-the-powershell-ise\/","url_meta":{"origin":8378,"position":5},"title":"PowerShell 7 Scripting with the PowerShell ISE","author":"Jeffery Hicks","date":"May 11, 2020","format":false,"excerpt":"By now, everyone should have gotten the memo that with the move to PowerShell 7, the PowerShell ISE should be considered deprecated. When it comes to PowerShell script and module development for PowerShell 7, the recommended tool is Visual Studio Code. It is free and offers so much more than\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\/05\/ise-ps7.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/05\/ise-ps7.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/05\/ise-ps7.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2020\/05\/ise-ps7.png?resize=700%2C400&ssl=1 2x"},"classes":[]}],"_links":{"self":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/8378","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=8378"}],"version-history":[{"count":0,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/8378\/revisions"}],"wp:attachment":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=8378"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=8378"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=8378"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}