File tree Expand file tree Collapse file tree 5 files changed +32
-9
lines changed Expand file tree Collapse file tree 5 files changed +32
-9
lines changed Original file line number Diff line number Diff line change 1+ # ###############################################################################
2+ # # File: Configure-Powershell.ps1
3+ # # Desc: Manage PowerShell configuration
4+ # ###############################################################################
5+
6+ # region System
7+ Write-Host " Setup PowerShellGet"
8+ Install-PackageProvider - Name NuGet - MinimumVersion 2.8 .5.201 - Force
9+
10+ # Specifies the installation policy
11+ Set-PSRepository - InstallationPolicy Trusted - Name PSGallery
12+ # endregion
13+
14+ # region User (current user, image generation only)
15+ if (-not (Test-Path $profile )) {
16+ New-Item $profile - ItemType File - Force
17+ }
18+
19+ @"
20+ if ( -not(Get-Module -ListAvailable -Name PowerHTML)) {
21+ Install-Module PowerHTML -Scope CurrentUser
22+ }
23+
24+ if ( -not(Get-Module -Name PowerHTML)) {
25+ Import-Module PowerHTML
26+ }
27+ "@ | Add-Content - Path $profile - Force
28+
29+ # endregion
Original file line number Diff line number Diff line change 11# Set TLS1.2
22[Net.ServicePointManager ]::SecurityProtocol = [Net.ServicePointManager ]::SecurityProtocol -bor " Tls12"
33
4- Write-Host " Setup PowerShellGet"
5- Install-PackageProvider - Name NuGet - MinimumVersion 2.8 .5.201 - Force
6-
7- # Specifies the installation policy
8- Set-PSRepository - InstallationPolicy Trusted - Name PSGallery
9-
104# Install PowerShell modules
115$modules = (Get-ToolsetContent ).powershellModules
126
@@ -29,4 +23,4 @@ foreach($module in $modules)
2923}
3024
3125Import-Module Pester
32- Invoke-PesterTests - TestFile " PowerShellModules" - TestName " PowerShellModules"
26+ Invoke-PesterTests - TestFile " PowerShellModules" - TestName " PowerShellModules"
Original file line number Diff line number Diff line change @@ -84,8 +84,6 @@ $toolsetVersions = Get-ToolsetContent | Select-Object -ExpandProperty toolcache
8484$pypyVersions = Invoke-RestMethod https:// downloads.python.org/ pypy/ versions.json
8585
8686# required for html parsing
87- Install-Module PowerHTML - Scope CurrentUser
88- Import-Module PowerHTML
8987$checksums = (Invoke-RestMethod - Uri ' https://www.pypy.org/checksums.html' | ConvertFrom-HTML ).SelectNodes(' //*[@id="content"]/article/div/pre' )
9088
9189Write-Host " Starting installation PyPy..."
Original file line number Diff line number Diff line change 150150 ],
151151 "scripts" : [
152152 " {{ template_dir }}/scripts/Installers/Configure-Antivirus.ps1" ,
153+ " {{ template_dir }}/scripts/Installers/Configure-PowerShell.ps1" ,
153154 " {{ template_dir }}/scripts/Installers/Install-PowerShellModules.ps1" ,
154155 " {{ template_dir }}/scripts/Installers/Install-WindowsFeatures.ps1" ,
155156 " {{ template_dir }}/scripts/Installers/Install-Choco.ps1" ,
Original file line number Diff line number Diff line change 134134 ],
135135 "scripts" : [
136136 " {{ template_dir }}/scripts/Installers/Configure-Antivirus.ps1" ,
137+ " {{ template_dir }}/scripts/Installers/Configure-PowerShell.ps1" ,
137138 " {{ template_dir }}/scripts/Installers/Install-PowerShellModules.ps1" ,
138139 " {{ template_dir }}/scripts/Installers/Install-WindowsFeatures.ps1" ,
139140 " {{ template_dir }}/scripts/Installers/Install-Choco.ps1" ,
You can’t perform that action at this time.
0 commit comments