@@ -11,70 +11,75 @@ $modulesToInstall = New-Object System.Collections.Generic.List[object]
1111# https://github.com/PSAppDeployToolkit/PSAppDeployToolkit
1212[void ]$modulesToInstall.Add (([PSCustomObject ]@ {
1313 ModuleName = ' PSAppDeployToolkit'
14- ModuleVersion = ' 4.0.5 '
14+ ModuleVersion = ' 4.1.0 '
1515 }))
1616# https://github.com/pester/Pester
1717[void ]$modulesToInstall.Add (([PSCustomObject ]@ {
18- ModuleName = ' Pester'
18+ ModuleName = ' Pester'
1919 ModuleVersion = ' 5.6.1'
2020 }))
2121# https://github.com/nightroman/Invoke-Build
2222[void ]$modulesToInstall.Add (([PSCustomObject ]@ {
23- ModuleName = ' InvokeBuild'
23+ ModuleName = ' InvokeBuild'
2424 ModuleVersion = ' 5.11.3'
2525 }))
2626# https://github.com/PowerShell/PSScriptAnalyzer
2727[void ]$modulesToInstall.Add (([PSCustomObject ]@ {
28- ModuleName = ' PSScriptAnalyzer'
28+ ModuleName = ' PSScriptAnalyzer'
2929 ModuleVersion = ' 1.23.0'
3030 }))
3131# https://github.com/PowerShell/platyPS
3232# older version used due to: https://github.com/PowerShell/platyPS/issues/457
3333[void ]$modulesToInstall.Add (([PSCustomObject ]@ {
34- ModuleName = ' platyPS'
34+ ModuleName = ' platyPS'
3535 ModuleVersion = ' 0.12.0'
3636 }))
3737# https://github.com/alt3/Docusaurus.Powershell
3838# Needed for our website documentation
3939[void ]$modulesToInstall.Add (([PSCustomObject ]@ {
40- ModuleName = ' Alt3.Docusaurus.Powershell'
40+ ModuleName = ' Alt3.Docusaurus.Powershell'
4141 ModuleVersion = ' 1.0.37'
4242 }))
4343
4444
4545
4646' Installing PowerShell Modules'
47- foreach ($module in $modulesToInstall ) {
47+ foreach ($module in $modulesToInstall )
48+ {
4849 $installSplat = @ {
49- Name = $module.ModuleName
50- RequiredVersion = $module.ModuleVersion
51- Repository = ' PSGallery'
50+ Name = $module.ModuleName
51+ RequiredVersion = $module.ModuleVersion
52+ Repository = ' PSGallery'
5253 SkipPublisherCheck = $true
53- Force = $true
54- Scope = ' CurrentUser'
55- ErrorAction = ' Stop'
54+ Force = $true
55+ Scope = ' CurrentUser'
56+ ErrorAction = ' Stop'
5657 }
57- try {
58- if ($module.ModuleName -eq ' Pester' -and ($IsWindows -or $PSVersionTable.PSVersion -le [version ]' 5.1' )) {
58+ try
59+ {
60+ if ($module.ModuleName -eq ' Pester' -and ($IsWindows -or $PSVersionTable.PSVersion -le [version ]' 5.1' ))
61+ {
5962 # special case for Pester certificate mismatch with older Pester versions - https://github.com/pester/Pester/issues/2389
6063 # this only affects windows builds
6164 Install-Module @installSplat - SkipPublisherCheck
6265 }
63- elseif ($module.ModuleName -eq ' PSAppDeployToolkit' ) {
66+ elseif ($module.ModuleName -eq ' PSAppDeployToolkit' )
67+ {
6468 # special case for Pester certificate mismatch with older Pester versions - https://github.com/pester/Pester/issues/2389
6569 # this only affects windows builds
6670 Install-Module @installSplat - AllowPreRelease
6771 }
68- else {
72+ else
73+ {
6974 Install-Module @installSplat
7075 }
7176 Import-Module - Name $module.ModuleName - ErrorAction Stop
7277 ' - Successfully installed {0}' -f $module.ModuleName
7378 }
74- catch {
79+ catch
80+ {
7581 $message = ' Failed to install {0}' -f $module.ModuleName
7682 " - $message "
7783 throw
7884 }
7985}
80-
0 commit comments