We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 8c32254 + a5cb843 commit 241b01eCopy full SHA for 241b01e
1 file changed
Install-RequiredModule.ps1
@@ -1,7 +1,15 @@
1
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
10
try {
- Install-Script Install-RequiredModule
- Install-RequiredModule
11
+ $Script = Install-Script Install-RequiredModule -PassThru -Force
12
+ & (Join-Path $Script.InstalledLocation Install-RequiredModule.ps1)
13
} finally {
14
Pop-Location
15
}
0 commit comments