Skip to content

Commit 241b01e

Browse files
committed
Merge branch 'feature/InitializeBetter'
2 parents 8c32254 + a5cb843 commit 241b01e

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

Install-RequiredModule.ps1

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
11
Push-Location $PSScriptRoot
2+
3+
# Some people only have a really old version of PowerShellGet that doesn't support pre-release modules
4+
if (!(Get-Command Install-Module -ParameterName 'AllowPrerelease' -ErrorAction 'SilentlyContinue')) {
5+
$Module = Install-Module 'PowerShellGet' -Repository 'PSGallery' -MaximumVersion 2.99 -MinimumVersion 2.2.5 -Force -Scope CurrentUser -PassThru
6+
Remove-Module PowerShellGet
7+
Import-Module PowerShellGet -MinimumVersion $Module.Version -Force
8+
}
9+
210
try {
3-
Install-Script Install-RequiredModule
4-
Install-RequiredModule
11+
$Script = Install-Script Install-RequiredModule -PassThru -Force
12+
& (Join-Path $Script.InstalledLocation Install-RequiredModule.ps1)
513
} finally {
614
Pop-Location
715
}

0 commit comments

Comments
 (0)