Automatically Confirm cmdlets

Some NAV PowerShell cmdlets (such as Import-NAVApplicationObject) don’t have the -Force switch, and always ask for confirmation regardless of whether you include the -Confirm switch or not.

To work around this, append the –Confirm:$false switch to such command. That sets the ConfirmPreference to none for an individual command, and confirms its confirmation dialogs.

Vjeko

Vjeko has been writing code for living since 1995, and he has shared his knowledge and experience in presentations, articles, blogs, and elsewhere since 2002. Hopelessly curious, passionate about technology, avid language learner no matter human or computer.

This Post Has 4 Comments

  1. Robert Tuck

    Once again coming to this sphere of knowledge pays dividends.

    Cheers,
    Robert
    🙂

    1. Vjeko

      Thanks! 🙂 I really appreciate your comment!

Leave a Reply