Skip to content

Commit

Permalink
win_psmodule - Missing SkipPublisherCheck in Prerq installations (ans…
Browse files Browse the repository at this point in the history
…ible#58090)

* win_psmodule - Missing SkipPublisherCheck in Prerq installations

* Handle different minors of PS5

* community revisions

* Update win_psmodule.ps1
  • Loading branch information
ShachafGoldstein authored and jborean93 committed Jul 4, 2019
1 parent db5656c commit 6e319ff
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bugfixes:
- "win_psmodule - Missing SkipPublisherCheck in Prerq installations"
12 changes: 11 additions & 1 deletion lib/ansible/modules/windows/win_psmodule.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,17 @@ Function Install-PrereqModule {
}
else {
try {
Install-Module -Name $Name -MinimumVersion $PrereqModules[$Name] -Force -WhatIf:$CheckMode | Out-Null
$install_params = @{
Name = $Name
MinimumVersion = $PrereqModules[$Name]
Force = $true
WhatIf = $CheckMode
}
if ((Get-Command -Name Install-Module).Parameters.ContainsKey('SkipPublisherCheck')) {
$install_params.SkipPublisherCheck = $true
}

Install-Module @install_params > $null

if ( $Name -eq 'PowerShellGet' ) {
# An order has to be reverted due to dependency
Expand Down

0 comments on commit 6e319ff

Please sign in to comment.