{"id":1869,"date":"2011-12-02T10:45:23","date_gmt":"2011-12-02T15:45:23","guid":{"rendered":"http:\/\/jdhitsolutions.com\/blog\/?p=1869"},"modified":"2011-12-02T10:45:23","modified_gmt":"2011-12-02T15:45:23","slug":"add-whatif-support-to-your-powershell-scripts","status":"publish","type":"post","link":"https:\/\/jdhitsolutions.com\/blog\/scripting\/1869\/add-whatif-support-to-your-powershell-scripts\/","title":{"rendered":"Add WhatIf Support to Your PowerShell Scripts"},"content":{"rendered":"<p>In one of my <a href=\"http:\/\/www.scriptlogic.com\/smbit\/article\/manage-&-purge-local-windows-user-profiles\" target=\"_blank\">recent articles<\/a> for SMB IT, I included a PowerShell module. In the article I referenced that I included support for -Whatif in one of the functions. I was asked on Twitter to explain what I meant and how it works. So here goes.<!--more--><\/p>\n<p>There are a few ways you can add support for -WhatIf in your PowerShell scripts and functions. The first thing you need to do is add the cmdletbinding attribute at the beginning of your script, before the Param() section, and set SupportsShouldProcess to $True. <\/p>\n<p>[cc lang=\"PowerShell\"]<br \/>\n[cmdletbinding(SupportsShouldProcess=$True)]<br \/>\n[\/cc]<\/p>\n<p>In a function you might do this:<\/p>\n<p>[cc lang=\"PowerShell\"]<br \/>\nFunction Remove-Data {<br \/>\n<#\ncomment based help goes here\n#><br \/>\n[cmdletbinding(SupportsShouldProcess=$True)]<br \/>\nParam()<br \/>\n...<br \/>\n[\/cc]<\/p>\n<p>Even if you have no parameters, you should still add the Param() statement for this to work properly. Once this is in place, when you run the function it will automatically support -WhatIf. If your function is calling cmdlets that also support -WhatIf, such as Remove-Item, then they will \"inherit\" the parameter. <\/p>\n<p>[cc lang=\"PowerShell\"]<br \/>\nPS C:\\> Remove-Data c:\\work\\f.txt -whatif<br \/>\nWhat if: Performing operation \"Remove File\" on Target \"C:\\work\\f.txt\".<br \/>\n[\/cc]<\/p>\n<p>In the function referenced in my SMBIT article that is exactly what I am doing. I'm merely passing -WhatIf on to other cmdlets. However, you can also write your own WhatIf handling. You still need the cmdletbinding attribute. But now, when you get to the part of your script where you want to add -WhatIf support you can add code like this:<\/p>\n<p>[cc lang=\"PowerShell\"]<br \/>\nif ($pscmdlet.ShouldProcess($Path)) {<br \/>\n  Write-Host \"Removing $path\" -foregroundcolor Yellow<br \/>\n  #my code to do something with $Path goes here<br \/>\n} #shouldprocess<br \/>\n[\/cc]<\/p>\n<p>Now when I run my function I get a slightly different output:<\/p>\n<p>[cc lang=\"DOS\"]<br \/>\nPS C:\\> remove-data c:\\work\\f.txt -whatif<br \/>\nWhat if: Performing operation \"Remove-Data\" on Target \"c:\\work\\f.txt\".<br \/>\n[\/cc]<\/p>\n<p>The operation is now the name of my function. This is a useful technique if you want to include WhatIf support using cmdlets that don't support it. I use conditional checks like this to test the flow of my more complicated scripts without actually having them do anything.<\/p>\n<p>As you can see, it is not that difficult and I encourage you to see how you can incorporate these feature into your PowerShell work.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In one of my recent articles for SMB IT, I included a PowerShell module. In the article I referenced that I included support for -Whatif in one of the functions. I was asked on Twitter to explain what I meant and how it works. So here goes.<\/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":[75,8],"tags":[32,534,540],"class_list":["post-1869","post","type-post","status-publish","format-standard","hentry","category-powershell-v2-0","category-scripting","tag-functions","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>Add WhatIf Support to Your PowerShell Scripts &#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\/scripting\/1869\/add-whatif-support-to-your-powershell-scripts\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Add WhatIf Support to Your PowerShell Scripts &#8226; The Lonely Administrator\" \/>\n<meta property=\"og:description\" content=\"In one of my recent articles for SMB IT, I included a PowerShell module. In the article I referenced that I included support for -Whatif in one of the functions. I was asked on Twitter to explain what I meant and how it works. So here goes.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jdhitsolutions.com\/blog\/scripting\/1869\/add-whatif-support-to-your-powershell-scripts\/\" \/>\n<meta property=\"og:site_name\" content=\"The Lonely Administrator\" \/>\n<meta property=\"article:published_time\" content=\"2011-12-02T15:45:23+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=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/1869\\\/add-whatif-support-to-your-powershell-scripts\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/1869\\\/add-whatif-support-to-your-powershell-scripts\\\/\"},\"author\":{\"name\":\"Jeffery Hicks\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"headline\":\"Add WhatIf Support to Your PowerShell Scripts\",\"datePublished\":\"2011-12-02T15:45:23+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/1869\\\/add-whatif-support-to-your-powershell-scripts\\\/\"},\"wordCount\":393,\"commentCount\":2,\"publisher\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"keywords\":[\"functions\",\"PowerShell\",\"Scripting\"],\"articleSection\":[\"PowerShell v2.0\",\"Scripting\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/1869\\\/add-whatif-support-to-your-powershell-scripts\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/1869\\\/add-whatif-support-to-your-powershell-scripts\\\/\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/1869\\\/add-whatif-support-to-your-powershell-scripts\\\/\",\"name\":\"Add WhatIf Support to Your PowerShell Scripts &#8226; The Lonely Administrator\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#website\"},\"datePublished\":\"2011-12-02T15:45:23+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/1869\\\/add-whatif-support-to-your-powershell-scripts\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/1869\\\/add-whatif-support-to-your-powershell-scripts\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/1869\\\/add-whatif-support-to-your-powershell-scripts\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"PowerShell v2.0\",\"item\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/category\\\/powershell-v2-0\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Add WhatIf Support to Your PowerShell Scripts\"}]},{\"@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":"Add WhatIf Support to Your PowerShell Scripts &#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\/scripting\/1869\/add-whatif-support-to-your-powershell-scripts\/","og_locale":"en_US","og_type":"article","og_title":"Add WhatIf Support to Your PowerShell Scripts &#8226; The Lonely Administrator","og_description":"In one of my recent articles for SMB IT, I included a PowerShell module. In the article I referenced that I included support for -Whatif in one of the functions. I was asked on Twitter to explain what I meant and how it works. So here goes.","og_url":"https:\/\/jdhitsolutions.com\/blog\/scripting\/1869\/add-whatif-support-to-your-powershell-scripts\/","og_site_name":"The Lonely Administrator","article_published_time":"2011-12-02T15:45:23+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":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/jdhitsolutions.com\/blog\/scripting\/1869\/add-whatif-support-to-your-powershell-scripts\/#article","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/scripting\/1869\/add-whatif-support-to-your-powershell-scripts\/"},"author":{"name":"Jeffery Hicks","@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"headline":"Add WhatIf Support to Your PowerShell Scripts","datePublished":"2011-12-02T15:45:23+00:00","mainEntityOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/scripting\/1869\/add-whatif-support-to-your-powershell-scripts\/"},"wordCount":393,"commentCount":2,"publisher":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"keywords":["functions","PowerShell","Scripting"],"articleSection":["PowerShell v2.0","Scripting"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/jdhitsolutions.com\/blog\/scripting\/1869\/add-whatif-support-to-your-powershell-scripts\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/jdhitsolutions.com\/blog\/scripting\/1869\/add-whatif-support-to-your-powershell-scripts\/","url":"https:\/\/jdhitsolutions.com\/blog\/scripting\/1869\/add-whatif-support-to-your-powershell-scripts\/","name":"Add WhatIf Support to Your PowerShell Scripts &#8226; The Lonely Administrator","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#website"},"datePublished":"2011-12-02T15:45:23+00:00","breadcrumb":{"@id":"https:\/\/jdhitsolutions.com\/blog\/scripting\/1869\/add-whatif-support-to-your-powershell-scripts\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jdhitsolutions.com\/blog\/scripting\/1869\/add-whatif-support-to-your-powershell-scripts\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/jdhitsolutions.com\/blog\/scripting\/1869\/add-whatif-support-to-your-powershell-scripts\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"PowerShell v2.0","item":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell-v2-0\/"},{"@type":"ListItem","position":2,"name":"Add WhatIf Support to Your PowerShell Scripts"}]},{"@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":4319,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4319\/powershell-blogging-week-supporting-whatif-and-confirm\/","url_meta":{"origin":1869,"position":0},"title":"PowerShell Blogging Week: Supporting WhatIf and Confirm","author":"Jeffery Hicks","date":"April 2, 2015","format":false,"excerpt":"We hope you are enjoying this experiment in community blogging. In today's contribution I want to demonstrate how you can add support for WhatIf and Confirm to your advanced PowerShell functions. It is actually quite easy, especially if your function is simply calling other PowerShell commands that already support \u2013Whatif\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":8424,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8424\/hiding-taskbar-search-with-powershell\/","url_meta":{"origin":1869,"position":1},"title":"Hiding TaskBar Search with PowerShell","author":"Jeffery Hicks","date":"May 21, 2021","format":false,"excerpt":"Yesterday I shared a few PowerShell functions for configuring the Windows 10 taskbar to auto-hide. This works great in my virtual desktop when recording my Pluralsight courses. But even when hidden I would still get an annoying white sliver from the search box. So I got rid of that as\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\/2021\/05\/show-searchbox.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/05\/show-searchbox.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/05\/show-searchbox.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/05\/show-searchbox.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":8420,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8420\/managing-the-windows-10-taskbar-with-powershell\/","url_meta":{"origin":1869,"position":2},"title":"Managing the Windows 10 Taskbar with PowerShell","author":"Jeffery Hicks","date":"May 20, 2021","format":false,"excerpt":"When I'm working on a Pluralsight course, I tend to setup a virtual machine for recording. Although, lately I've been trying with Windows 10 Sandbox. This is handy when all I need is a Windows 10 desktop. When I setup the system, I have particular settings I need to configure.\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\/2021\/05\/taskbar-regsettings.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/05\/taskbar-regsettings.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/05\/taskbar-regsettings.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/05\/taskbar-regsettings.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":1483,"url":"https:\/\/jdhitsolutions.com\/blog\/scripting\/1483\/test-port-2-0\/","url_meta":{"origin":1869,"position":3},"title":"Test Port 2.0","author":"Jeffery Hicks","date":"May 31, 2011","format":false,"excerpt":"A few years ago I updated a PowerShell script I came across to scan a computer for open ports. My initial revision was aimed at making it more pipeline friendly in PowerShell v1.0. I recently needed to use the function for a project and realized it could benefit from a\u2026","rel":"","context":"In &quot;PowerShell v2.0&quot;","block_context":{"text":"PowerShell v2.0","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell-v2-0\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/05\/test-port-300x126.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":4268,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4268\/friday-fun-size-me-up\/","url_meta":{"origin":1869,"position":4},"title":"Friday Fun: Size Me Up","author":"Jeffery Hicks","date":"March 6, 2015","format":false,"excerpt":"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\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":[]},{"id":8241,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8241\/cleaning-with-powershell-revisited\/","url_meta":{"origin":1869,"position":5},"title":"Cleaning with PowerShell Revisited","author":"Jeffery Hicks","date":"March 23, 2021","format":false,"excerpt":"Springtime is approaching in North America. Where I live, the snow has finally melted and we have blue skies with warmer temperatures. Of course, this means Spring Cleaning. Time to clear out the winter debris and spruce up the house. For me, this is also a good time for some\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\/2021\/03\/remove-file.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/03\/remove-file.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/03\/remove-file.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/03\/remove-file.png?resize=700%2C400&ssl=1 2x"},"classes":[]}],"_links":{"self":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/1869","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=1869"}],"version-history":[{"count":0,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/1869\/revisions"}],"wp:attachment":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=1869"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=1869"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=1869"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}