mirror of
https://github.com/actions/runner-images.git
synced 2025-12-25 19:11:28 +08:00
* windows: implement separate step for configuring Powershell * windows: refactor PyPy checksum validation PyPy checksum validation uses PowerHTML module which is now available as a part of powershell profile * reformat * Update images/win/scripts/Installers/Configure-PowerShell.ps1 Co-authored-by: Vasilii Polikarpov <126792224+vpolikarpov-akvelon@users.noreply.github.com> --------- Co-authored-by: Vasilii Polikarpov <126792224+vpolikarpov-akvelon@users.noreply.github.com>
30 lines
852 B
PowerShell
30 lines
852 B
PowerShell
################################################################################
|
|
## File: Configure-Powershell.ps1
|
|
## Desc: Manage PowerShell configuration
|
|
################################################################################
|
|
|
|
#region System
|
|
Write-Host "Setup PowerShellGet"
|
|
Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force
|
|
|
|
# Specifies the installation policy
|
|
Set-PSRepository -InstallationPolicy Trusted -Name PSGallery
|
|
#endregion
|
|
|
|
#region User (current user, image generation only)
|
|
if (-not (Test-Path $profile)) {
|
|
New-Item $profile -ItemType File -Force
|
|
}
|
|
|
|
@"
|
|
if ( -not(Get-Module -ListAvailable -Name PowerHTML)) {
|
|
Install-Module PowerHTML -Scope CurrentUser
|
|
}
|
|
|
|
if ( -not(Get-Module -Name PowerHTML)) {
|
|
Import-Module PowerHTML
|
|
}
|
|
"@ | Add-Content -Path $profile -Force
|
|
|
|
#endregion
|