{"id":238,"date":"2010-03-04T22:47:39","date_gmt":"2010-03-05T03:47:39","guid":{"rendered":"http:\/\/nukeitmike.com\/blog\/2010\/03\/04\/powershell-confirm-preference\/%20"},"modified":"2010-03-04T22:47:39","modified_gmt":"2010-03-05T03:47:39","slug":"powershell-confirm-preference","status":"publish","type":"post","link":"https:\/\/blog.nukeitmike.com\/index.php\/2010\/03\/04\/powershell-confirm-preference\/","title":{"rendered":"PowerShell Confirm Preference"},"content":{"rendered":"<p> I seem to run into an issue when I run some PowerShell scripts where I get prompted at each line of the script for confirmation.&#160; That can get really annoying, so I have to look up how to prevent that behavior.&#160; Thankfully, there is already some good information out there on how to do that: <\/p>\n<blockquote>\n<p>When confirmation is turned on by $ConfirmPreference, you can turn it off for any individual cmdlet invocation using &quot;-Confirm:$false&quot;.&#160; You can also use &quot;-Confirm:$false&quot; to turn off default confirmation for high impact cmdlets such as Removing a Mailbox.&#160; Another way to turn off confirmation is by setting $ConfirmPreference to &quot;None&quot;; you can limit the effect by setting $script:ConfirmPreference etc, see &quot;get-help about_scope&quot; for more details.<\/p>\n<\/blockquote>\n<p>For more details and options besides just turning it off, go see the original post:<\/p>\n<p><a href=\"http:\/\/blogs.msdn.com\/powershell\/archive\/2006\/12\/15\/confirmpreference.aspx\">Windows PowerShell Blog : ConfirmPreference<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I seem to run into an issue when I run some PowerShell scripts where I get prompted at each line of the script for confirmation.&#160; That can get really annoying, so I have to look up how to prevent that behavior.&#160; Thankfully, there is already some good information out there on how to do that:&hellip; <a class=\"more-link\" href=\"https:\/\/blog.nukeitmike.com\/index.php\/2010\/03\/04\/powershell-confirm-preference\/\">Continue reading <span class=\"screen-reader-text\">PowerShell Confirm Preference<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"advanced_seo_description":"","jetpack_seo_html_title":"","jetpack_seo_noindex":false,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[25],"tags":[135,154],"class_list":["post-238","post","type-post","status-publish","format-standard","hentry","category-scripting","tag-powershell","tag-scripting","entry"],"jetpack_featured_media_url":"","jetpack-related-posts":[],"jetpack_likes_enabled":true,"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/pcW544-3Q","_links":{"self":[{"href":"https:\/\/blog.nukeitmike.com\/index.php\/wp-json\/wp\/v2\/posts\/238","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.nukeitmike.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.nukeitmike.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.nukeitmike.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.nukeitmike.com\/index.php\/wp-json\/wp\/v2\/comments?post=238"}],"version-history":[{"count":0,"href":"https:\/\/blog.nukeitmike.com\/index.php\/wp-json\/wp\/v2\/posts\/238\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.nukeitmike.com\/index.php\/wp-json\/wp\/v2\/media?parent=238"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.nukeitmike.com\/index.php\/wp-json\/wp\/v2\/categories?post=238"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.nukeitmike.com\/index.php\/wp-json\/wp\/v2\/tags?post=238"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}