File tree 5 files changed +32
-9
lines changed
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 1
1
# Set TLS1.2
2
2
[Net.ServicePointManager ]::SecurityProtocol = [Net.ServicePointManager ]::SecurityProtocol -bor " Tls12"
3
3
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
-
10
4
# Install PowerShell modules
11
5
$modules = (Get-ToolsetContent ).powershellModules
12
6
@@ -29,4 +23,4 @@ foreach($module in $modules)
29
23
}
30
24
31
25
Import-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
84
84
$pypyVersions = Invoke-RestMethod https:// downloads.python.org/ pypy/ versions.json
85
85
86
86
# required for html parsing
87
- Install-Module PowerHTML - Scope CurrentUser
88
- Import-Module PowerHTML
89
87
$checksums = (Invoke-RestMethod - Uri ' https://www.pypy.org/checksums.html' | ConvertFrom-HTML ).SelectNodes(' //*[@id="content"]/article/div/pre' )
90
88
91
89
Write-Host " Starting installation PyPy..."
Original file line number Diff line number Diff line change 150
150
],
151
151
"scripts" : [
152
152
" {{ template_dir }}/scripts/Installers/Configure-Antivirus.ps1" ,
153
+ " {{ template_dir }}/scripts/Installers/Configure-PowerShell.ps1" ,
153
154
" {{ template_dir }}/scripts/Installers/Install-PowerShellModules.ps1" ,
154
155
" {{ template_dir }}/scripts/Installers/Install-WindowsFeatures.ps1" ,
155
156
" {{ template_dir }}/scripts/Installers/Install-Choco.ps1" ,
Original file line number Diff line number Diff line change 134
134
],
135
135
"scripts" : [
136
136
" {{ template_dir }}/scripts/Installers/Configure-Antivirus.ps1" ,
137
+ " {{ template_dir }}/scripts/Installers/Configure-PowerShell.ps1" ,
137
138
" {{ template_dir }}/scripts/Installers/Install-PowerShellModules.ps1" ,
138
139
" {{ template_dir }}/scripts/Installers/Install-WindowsFeatures.ps1" ,
139
140
" {{ template_dir }}/scripts/Installers/Install-Choco.ps1" ,
You can’t perform that action at this time.
0 commit comments