The community is undergoing maintenance and is in Read-Only mode. Click to learn more.

Microsoft Virtualization Discussions

Invoke-NaSnapmirrorBreak without prompting

hollandwl

When I use the Invoke-SnapmirrorBreak cmdlet, I am prompted to enter Y, A, N, L, S, or ? to confirm or reject this operation.  I don't want to be prompted, I simply want it to perform the operation.  I've tried using the -Confirm parameter but I get the same results.  If I respond to the prompts, it performs the desired action.  However, I am creating scripts that will be run as part of an automated process with no user available to provide input.

Any ideas?

1 ACCEPTED SOLUTION

cknight

You can also pass -Confirm:$false to any cmdlet to disable prompts only for its invocation.  PowerShell's default value of $ConfirmPreference is "High".  Most confirmations in the Toolkit are "Low" or "Medium", primarily reserving "High" for those that impact data such as removing LUNs, Volumes, etc.

View solution in original post

3 REPLIES 3

hollandwl

I found the solution.  I did $ConfirmPreference = "None" at the beginning of the script and it removed the prompts.

cknight

You can also pass -Confirm:$false to any cmdlet to disable prompts only for its invocation.  PowerShell's default value of $ConfirmPreference is "High".  Most confirmations in the Toolkit are "Low" or "Medium", primarily reserving "High" for those that impact data such as removing LUNs, Volumes, etc.

View solution in original post

hollandwl

Thanks.  I'm still new to Powershell, so a lot to learn yet.

Announcements
NetApp on Discord Image

We're on Discord, are you?

Live Chat, Watch Parties, and More!

Explore Banner

Meet Explore, NetApp’s digital sales platform

Engage digitally throughout the sales process, from product discovery to configuration, and handle all your post-purchase needs.

NetApp Insights to Action
I2A Banner
Public