{"id":3671,"date":"2022-10-10T19:50:38","date_gmt":"2022-10-10T19:50:38","guid":{"rendered":"http:\/\/putridparrot.com\/blog\/?p=3671"},"modified":"2022-10-10T19:50:38","modified_gmt":"2022-10-10T19:50:38","slug":"what-happens-if-i-run-this-command-in-powershell","status":"publish","type":"post","link":"https:\/\/putridparrot.com\/blog\/what-happens-if-i-run-this-command-in-powershell\/","title":{"rendered":"What happens if I run this command in Powershell"},"content":{"rendered":"<p>As Powershell allows us to do things, like stop process, move files and more, we might prefer to check &#8220;what if I run this command&#8221; before actually executing it.<\/p>\n<p><strong>Whatif<\/strong><\/p>\n<p>Let&#8217;s assume we want to stop several processes, but before executing the command we&#8217;d like to see some output showing what the command will do.<\/p>\n<p>For example<\/p>\n<pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\r\nGet-Process *host | Stop-Process -whatif\r\n<\/pre>\n<p>Instead of actually stopping the processes found via the wildcard *host this will output a list of &#8220;what if&#8221; statements, showing the operation which would take place against which target (process).<\/p>\n<p>So we might notice that our wildcard includes unintended consequences and can thus save ourselves the headache unwanted changes.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>As Powershell allows us to do things, like stop process, move files and more, we might prefer to check &#8220;what if I run this command&#8221; before actually executing it. Whatif Let&#8217;s assume we want to stop several processes, but before executing the command we&#8217;d like to see some output showing what the command will do. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[118],"tags":[],"class_list":["post-3671","post","type-post","status-publish","format-standard","hentry","category-powershell"],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/posts\/3671","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/comments?post=3671"}],"version-history":[{"count":1,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/posts\/3671\/revisions"}],"predecessor-version":[{"id":3672,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/posts\/3671\/revisions\/3672"}],"wp:attachment":[{"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/media?parent=3671"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/categories?post=3671"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/tags?post=3671"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}