mirror of
https://github.com/actions/runner-images.git
synced 2025-12-13 04:37:09 +00:00
* Use Resolve-GithubReleaseAssetUrl more widely * Add the Get-ChecksumFromUrl function * Sort exported functions and add docs * Remove alias and fix typo * Fix kind checksum url and syntax * Fix checksums url for gh cli and msys2 * [Windows] Cleanup various scripts * Add spaces after type specifications * Rename the Take-Part function
28 lines
1003 B
PowerShell
28 lines
1003 B
PowerShell
################################################################################
|
|
## File: Install-PowershellModules.ps1
|
|
## Desc: Install common PowerShell modules
|
|
################################################################################
|
|
|
|
# Set TLS1.2
|
|
[Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor "Tls12"
|
|
|
|
# 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
|
|
}
|
|
} else {
|
|
Install-Module -Name $moduleName -Scope AllUsers -SkipPublisherCheck -Force
|
|
}
|
|
}
|
|
|
|
Import-Module Pester
|
|
Invoke-PesterTests -TestFile "PowerShellModules" -TestName "PowerShellModules"
|