How to Get Rid of "Confirm" Dialogs?

Use this forum to ask questions after your subscription maintenance expires or before you buy. Need information on licensing or pricing? Questions about a trial version? This is the right place for you. No scripting questions, please.
Forum rules
DO NOT POST SUBSCRIPTION NUMBERS, LICENSE KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.
This topic is 8 years and 11 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
User avatar
SeaDude
Posts: 45
Last visit: Mon Aug 03, 2015 3:36 pm

How to Get Rid of "Confirm" Dialogs?

Post by SeaDude »

Hello,

When running a GUI script, I seem to get a "Confirm" dialog box for certain cmdlets in my script. How do I stop these from popping up?

Thanks!
Attachments
confirm_howtostop.jpg
confirm_howtostop.jpg (30.05 KiB) Viewed 3806 times
User avatar
SAPIEN Support Forums
Posts: 945
Last visit: Thu Oct 22, 2015 1:10 pm

How to Get Rid of "Confirm" Dialogs?

Post by SAPIEN Support Forums »

This is an automated post. A real person will respond soon.

Thank you for posting, SeaDude.

Did you remember to include the following?
  • 1. Product, version and build (e.g. Product: PrimalScript 2014, Version & Build: 7.0.46. Version and build information can be found in the product's About box accessed by clicking the blue icon with the 'i' in the upper right hand corner of the ribbon.)
    2. Specify if you are running a 32 or 64 bit version
    3. Specify your operating system and if it is 32 or 64 bit.
    4. Attach a screenshot if your issue can be seen on the screen
    5. Attach a zip file if you have multiple files (crash reports, log entries, etc.) related to your issue.
If not, please take a moment to edit your original post or reply to this one.

*** Make sure you do not post any licensing information ***
User avatar
Alexander Riedel
Posts: 8489
Last visit: Thu Apr 18, 2024 1:15 pm
Answers: 20
Been upvoted: 37 times

Re: How to Get Rid of "Confirm" Dialogs?

Post by Alexander Riedel »

Read documentation for the cmdlet:
https://technet.microsoft.com/en-us/library/jj130903.aspx

EXAMPLE 4
This example disables the network adapter named MyAdapter.


Windows PowerShell
PS C:\> Disable-NetAdapter –Name MyAdapter
Confirm 
Are you sure you want to perform this action? 
Disable-NetAdapter ꞌMyAdapter'

Windows PowerShell
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"):Y

A version of the cmdlet that overrides the default confirmation prompt when disabling the network adapter named MyAdapter. For more information about changing the default confirmation prompt, see the $ConfirmPreference variable by running the Get-Help –Name about_Preference_Variables cmdlet.

Windows PowerShell
PS C:\> Disable-NetAdapter –Name MyAdapter –Confirm:$false
Alexander Riedel
SAPIEN Technologies, Inc.
User avatar
SeaDude
Posts: 45
Last visit: Mon Aug 03, 2015 3:36 pm

Re: How to Get Rid of "Confirm" Dialogs?

Post by SeaDude »

Aha! For some reason I thought I had executed the commands in PowerShell with no confirm required. But went through and tested the cmdlets in question. Each one did require a confirm.
Will follow your lead.

Sorry for the lame question.

E
This topic is 8 years and 11 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.