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
This commit is contained in:
parent
db5656cf6e
commit
6e319ff088
2 changed files with 13 additions and 1 deletions
|
@ -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…
Reference in a new issue