Skip to content

TrustRepository in -RequiredResource should be respected #1900

@Gijsreyn

Description

@Gijsreyn

Prerequisites

  • Write a descriptive title.
  • Make sure you are able to repro it on the latest released version
  • Search the existing issues.

Steps to reproduce

Whenever I'm trying to install a module using the -RequiredResource with -TrustRepository in the hashtable, it still prompts me to confirm installation when a repository is untrusted. I have to add -TrustRepository add the end of the command, for example: Install-PSResource -RequiredResource @{ MyModule = @{ Repository = 'PSGallery'; TrustRepository = $true}} -TrustRepository.

Expected behavior

When `TrustRepository` is passed in through `-RequiredResource`, it should be respected.

Actual behavior

Prompts for confirmation

Error details

N/A

Environment data

ModuleType Version    PreRelease Name                                ExportedCommands
---------- -------    ---------- ----                                ----------------
Binary     1.1.0      preview1   Microsoft.PowerShell.PSResourceGet  {Find-PSResource, Get-InstalledPSResource, Get-PS…

Key   : PSVersion
Value : 7.5.3
Name  : PSVersion


Key   : PSEdition
Value : Core
Name  : PSEdition


Key   : GitCommitId
Value : 7.5.3
Name  : GitCommitId


Key   : OS
Value : Microsoft Windows 10.0.26100
Name  : OS


Key   : Platform
Value : Win32NT
Name  : Platform


Key   : PSCompatibleVersions
Value : {1.0, 2.0, 3.0, 4.0…}
Name  : PSCompatibleVersions


Key   : PSRemotingProtocolVersion
Value : 2.3
Name  : PSRemotingProtocolVersion


Key   : SerializationVersion
Value : 1.1.0.1
Name  : SerializationVersion


Key   : WSManStackVersion
Value : 3.0
Name  : WSManStackVersion

Visuals

No response

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