Skip to content

Commit a799aa8

Browse files
committed
Import-Module inside vsts-prerequisites.ps1
I have seen several failed builds over the last few day with errors like it found the command, but could not load the module. Here we load the module explicitly and get the version into the logs
1 parent 8b43816 commit a799aa8

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed
Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
Write-Host "Installing Pester" -ForegroundColor Cyan
2-
Install-Module Pester -Force -SkipPublisherCheck
3-
Write-Host "Installing PSFramework" -ForegroundColor Cyan
4-
Install-Module PSFramework -Force -SkipPublisherCheck
5-
Write-Host "Installing PSScriptAnalyzer" -ForegroundColor Cyan
6-
Install-Module PSScriptAnalyzer -Force -SkipPublisherCheck
1+
$modules = @("Pester", "PSFramework", "PSScriptAnalyzer")
2+
3+
foreach ($module in $modules) {
4+
Write-Host "Installing $module" -ForegroundColor Cyan
5+
Install-Module $module -Force -SkipPublisherCheck
6+
Import-Module $module -Force -PassThru
7+
}

0 commit comments

Comments
 (0)