win_psmodule - Missing SkipPublisherCheck in Prerq installations (#58090)

* win_psmodule - Missing SkipPublisherCheck in Prerq installations

* Handle different minors of PS5

* community revisions

* Update win_psmodule.ps1
pull/58742/head
Shachaf92 5 years ago committed by Jordan Borean
parent db5656cf6e
commit 6e319ff088

@ -0,0 +1,2 @@
bugfixes:
- "win_psmodule - Missing SkipPublisherCheck in Prerq installations"

@ -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

Loading…
Cancel
Save