PowerShellGetv2 icon indicating copy to clipboard operation
PowerShellGetv2 copied to clipboard

the installationpolicy of the PSGallery does not change even when the output states that

Open fabricesemti80 opened this issue 1 year ago • 2 comments

Prerequisites

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

Steps to reproduce

As I explained it here: https://stackoverflow.com/questions/74549128/why-is-the-installationpolicy-of-the-psgallery-does-not-change-even-when-puppet?noredirect=1#comment131597704_74549128 I am using the Puppet module wrapped around this, and it gives me the output it changed the galery from untrusted to trusted, but in reallity - checking after the Puppet run with Get-Psgalery - it is not updated. On Stack overflow I have been suggested it is rather an issue with the module than Puppet, so I am hoping to get some advise?

Expected behavior

Repo changes from `untrusted` to `trusted` installationpolicy

Actual behavior

Repo's installation policy does not change

Error details

no error

Environment data

PS C:\Users\Administrator> Get-Module PowerShellGet; $PSVersionTable 

Name                           Value                                                                                                                                                                                                              
----                           -----                                                                                                                                                                                                              
PSVersion                      5.1.17763.592                                                                                                                                                                                                      
PSEdition                      Desktop                                                                                                                                                                                                            
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}                                                                                                                                                                                            
BuildVersion                   10.0.17763.592                                                                                                                                                                                                     
CLRVersion                     4.0.30319.42000                                                                                                                                                                                                    
WSManStackVersion              3.0                                                                                                                                                                                                                
PSRemotingProtocolVersion      2.3                                                                                                                                                                                                                
SerializationVersion           1.1.0.1

Visuals

No response

fabricesemti80 avatar Nov 24 '22 08:11 fabricesemti80

@fabricesemti80 looking at the link you posted in the Stack Overflow post > Usage section > the example recommends that installation policy is case sensitive and should be trusted or untrusted. It also does not use quotes around the installationpolicy text as in the example you shared. Can you try it like the example in the Usage section?

anamnavi avatar Nov 28 '22 19:11 anamnavi

Thanks for your reply @anamnavi

I changed the code to

  ## ensure PSGallery is present - relies on mod 'dsc-powershellget', '2.2.5-0-3'
  dsc_psrepository { 'Trust public gallery':
    dsc_name               => 'PSGallery',
    dsc_ensure             => 'Present',
    dsc_installationpolicy => trusted,
  }

image

Puppet says it is applied, but there is no change in reallity.

image

fabricesemti80 avatar Dec 03 '22 12:12 fabricesemti80