Subscribe
Accepted Solution

Invoke-NaSnapmirrorBreak without prompting

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?

Re: Invoke-NaSnapmirrorBreak without prompting

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

Re: Invoke-NaSnapmirrorBreak without prompting

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.

Re: Invoke-NaSnapmirrorBreak without prompting

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