mirror of
https://github.com/actions/runner-images.git
synced 2025-12-14 13:17:54 +00:00
[Ubuntu] Implement new directories hierarchy (#8627)
This commit is contained in:
committed by
GitHub
parent
d1f2c9a3be
commit
5d40b1e213
34
images/ubuntu/scripts/build/Install-PowerShellModules.ps1
Normal file
34
images/ubuntu/scripts/build/Install-PowerShellModules.ps1
Normal file
@@ -0,0 +1,34 @@
|
||||
$ErrorActionPreference = "Stop"
|
||||
$ProgressPreference = "SilentlyContinue"
|
||||
|
||||
Import-Module "$env:HELPER_SCRIPTS/Tests.Helpers.psm1" -DisableNameChecking
|
||||
|
||||
# Specifies the installation policy
|
||||
Set-PSRepository -InstallationPolicy Trusted -Name PSGallery
|
||||
|
||||
# Try to update PowerShellGet before the actual installation
|
||||
Install-Module -Name PowerShellGet -Force
|
||||
Update-Module -Name PowerShellGet -Force
|
||||
|
||||
# Install PowerShell modules
|
||||
$modules = (Get-ToolsetContent).powershellModules
|
||||
|
||||
foreach($module in $modules)
|
||||
{
|
||||
$moduleName = $module.name
|
||||
Write-Host "Installing ${moduleName} module"
|
||||
|
||||
if ($module.versions)
|
||||
{
|
||||
foreach ($version in $module.versions)
|
||||
{
|
||||
Write-Host " - $version"
|
||||
Install-Module -Name $moduleName -RequiredVersion $version -Scope AllUsers -SkipPublisherCheck -Force
|
||||
}
|
||||
continue
|
||||
}
|
||||
|
||||
Install-Module -Name $moduleName -Scope AllUsers -SkipPublisherCheck -Force
|
||||
}
|
||||
|
||||
Invoke-PesterTests -TestFile "PowerShellModules" -TestName "PowerShellModules"
|
||||
Reference in New Issue
Block a user