{"id":1911,"date":"2016-09-01T17:32:59","date_gmt":"2016-09-01T17:32:59","guid":{"rendered":"http:\/\/microsoftgeek.com\/?p=1911"},"modified":"2016-09-01T17:41:39","modified_gmt":"2016-09-01T17:41:39","slug":"powershell-use-a-destructive-powershell-cmdlet-safely","status":"publish","type":"post","link":"https:\/\/microsoftgeek.com\/?p=1911","title":{"rendered":"PowerShell: Use a destructive PowerShell cmdlet safely"},"content":{"rendered":"<p>PowerShell has a built-in safety switch to many of its cmdlets.<\/p>\n<p>The <strong>\u2013whatif<\/strong> parameter, which is meant to <u>show<\/u> you what would happen if you used a PowerShell cmdlet without actually executing the cmdlet. An example of this in action is in the following <strong>Remove-Item<\/strong> cmdlet.<\/p>\n<p>&nbsp;<\/p>\n<p>This will attempt to remove\u00a0the document, HSG-Article-Sean-Should-Not-Lose.docx, without actually removing it.<\/p>\n<h3><em><strong><code>Remove-Item .\\HSG-Article-Sean-Should-Not-Lose.docx -WhatIf<\/code><\/strong><\/em><\/h3>\n","protected":false},"excerpt":{"rendered":"<p>PowerShell has a built-in safety switch to many of its cmdlets. The \u2013whatif parameter, which is meant to show you what would happen if you used a PowerShell cmdlet without actually executing the cmdlet. An example of this in action is in the following Remove-Item cmdlet. &nbsp; This will attempt to remove\u00a0the document, HSG-Article-Sean-Should-Not-Lose.docx, without [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[59],"tags":[],"class_list":["post-1911","post","type-post","status-publish","format-standard","hentry","category-powershell"],"_links":{"self":[{"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/posts\/1911","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1911"}],"version-history":[{"count":3,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/posts\/1911\/revisions"}],"predecessor-version":[{"id":1920,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/posts\/1911\/revisions\/1920"}],"wp:attachment":[{"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1911"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1911"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1911"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}