How do i stop getting prompted to confirm?

Welcome Forums General PowerShell Q&A How do i stop getting prompted to confirm?

This topic contains 2 replies, has 2 voices, and was last updated by

 
Participant
1 week, 4 days ago.

  • Author
    Posts
  • #156756

    Participant
    Topics: 22
    Replies: 62
    Points: 352
    Rank: Contributor

    I am trying to install Install-Module -Name SqlServer -confirm:$false on many servers. I am running this as Admin

    however i keep getting a prompt to confirm even though I have specified -confirm:$false

    NuGet provider is required to continue
    PowerShellGet requires NuGet provider version '2.8.5.201' or newer to interact with NuGet-based repositories. The NuGet
     provider must be available in 'C:\Program Files\PackageManagement\ProviderAssemblies' or
    'C:\Users\\AppData\Local\PackageManagement\ProviderAssemblies'. You can also install the NuGet provider by
    running 'Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force'. Do you want PowerShellGet to install
    and import the NuGet provider now?
    [Y] Yes  [N] No  [S] Suspend  [?] Help (default is "Y"):

    I also tried -force instead, and same thing, it keep prompting me to confirm...

    This will not be ideal because if i want to use a script to install the module, i will have to be there to confirm, which defeats the purpose

    posted here as well in case get an answer: https://stackoverflow.com/questions/56157269/why-do-i-keep-getting-prompted-to-confirm

  • #156767

    Participant
    Topics: 0
    Replies: 34
    Points: 308
    Helping Hand
    Rank: Contributor

    I think it's a version dependency you need, so it's not really a confirm impact.

  • #156773

    Participant
    Topics: 22
    Replies: 62
    Points: 352
    Rank: Contributor

    I think it's a version dependency you need, so it's not really a confirm impact.

    thats right 🙂

    linking answer from peter: https://stackoverflow.com/a/56157540/8397835

    Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force
  • #156764

    Participant
    Topics: 0
    Replies: 1
    Points: -11
    Rank: Member

    Consider checking what your console is using for the PackageProvider for Nuget  by running

    Get-PackageProvider

    This could at least give you some direction to finding why the error is showing a version mismatch.

You must be logged in to reply to this topic.

denizli escort samsun escort muğla escort ataşehir escort kuşadası escort