Skip to content
This repository was archived by the owner on Jun 13, 2024. It is now read-only.
This repository was archived by the owner on Jun 13, 2024. It is now read-only.

Install-Module -Confirm:$false still prompts on untrusted repository #461

Open
@KevinMarquette

Description

@KevinMarquette

When installing modules from an untrusted repository, I have to specify -Force instead of -Confirm:$false to suppress the prompt. The issue with using -Force is that it forces the reinstall of all the dependent modules.

Steps to reproduce

    Install-Module az -AllowClobber -Verbose -AcceptLicense -Confirm:$false -Repository PSGallery

Expected behavior

The module should not prompt for input

Actual behavior

Untrusted repository
You are installing the modules from an untrusted repository. If you trust this repository, change its
InstallationPolicy value by running the Set-PSRepository cmdlet. Are you sure you want to install the modules from
'PSGallery'?
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "N"):

Environment data

> $PSVersionTable
Name                           Value
----                           -----
PSVersion                      6.2.0-rc.1
PSEdition                      Core
GitCommitId                    6.2.0-rc.1
OS                             Microsoft Windows 10.0.17134
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0
> Get-Module -ListAvailable PowerShellGet,PackageManagement


    Directory: C:\Users\kmarquette\Documents\PowerShell\Modules

ModuleType Version    Name                                PSEdition ExportedCommands
---------- -------    ----                                --------- ----------------
Script     2.1.2      PowerShellGet                       Desk      {Find-Command, Find-DSCResource, Find-Module, Find…

    Directory: C:\program files\powershell\6-preview\Modules

ModuleType Version    Name                                PSEdition ExportedCommands
---------- -------    ----                                --------- ----------------
Script     1.3.1      PackageManagement                   Desk      {Find-Package, Get-Package, Get-PackageProvider, G…
Script     2.0.4      PowerShellGet                       Desk      {Find-Command, Find-DSCResource, Find-Module, Find…
> Get-PackageProvider -ListAvailable

Name                     Version          DynamicOptions
----                     -------          --------------
NuGet                    3.0.0.1          Destination, ExcludeVersion, Scope, SkipDependencies, Headers, FilterOnTag, …
PowerShellGet            2.1.2.0          PackageManagementProvider, Type, Scope, AllowClobber, SkipPublisherCheck, In…
PowerShellGet            2.0.4.0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions