10
10
$ProgressPreference = ' SilentlyContinue' # Suppresses progress, which doesn't render correctly in docker
11
11
12
12
# PowerShellGallery PROD site
13
- $prodGallery = ' https://www.powershellgallery.com/api/v2'
13
+ $prodGallery = ' https://www.powershellgallery.com/api/v2'
14
14
15
15
$script :pscloudshellBlob = $null # Version folder for the pscloudshell blob storage
16
16
$shareModulePath = ([System.Management.Automation.Platform ]::SelectProductNameForDirectory(' SHARED_MODULES' ))
@@ -31,7 +31,7 @@ function Get-DockerfileData {
31
31
$script :dockerfileDataObject = Microsoft.PowerShell.Management\Get-Content $dockerFileData | Microsoft.PowerShell.Utility\ConvertFrom-Json
32
32
if (-not $script :dockerfileDataObject ) {
33
33
throw " Error while reading $dockerFileData file."
34
- }
34
+ }
35
35
$pscloudshellVer = $script :dockerfileDataObject.PSCloudShellVersion
36
36
$script :pscloudshellBlob = " https://pscloudshellbuild.blob.core.windows.net/$pscloudshellVer "
37
37
Write-Output " pscloudshellVersion= $pscloudshellVer ; pscloudshellBlob=$script :pscloudshellBlob "
@@ -57,8 +57,8 @@ function Install-LibMIFile {
57
57
function Install-AzAndAzAdModules {
58
58
Write-Output " Install-AzAndAdModules.."
59
59
mkdir temp
60
- curl - o az- cmdlets.tar.gz - sSL " https://azpspackage.blob.core.windows.net/release/Az-Cmdlets-latest.tar.gz"
61
- tar - xf az- cmdlets.tar.gz - C temp
60
+ curl - o az- cmdlets.tar.gz - sSL " https://azpspackage.blob.core.windows.net/release/Az-Cmdlets-latest.tar.gz"
61
+ tar - xf az- cmdlets.tar.gz - C temp
62
62
rm az- cmdlets.tar.gz
63
63
cd temp
64
64
@@ -118,10 +118,10 @@ try {
118
118
119
119
if ($image -eq " Base" ) {
120
120
Write-Output " Installing modules from production gallery"
121
- PowerShellGet\Install-Module - Name SHiPS @prodAllUsers
121
+ PowerShellGet\Install-Module - Name SHiPS @prodAllUsers
122
122
PowerShellGet\Install-Module - Name SQLServer - MaximumVersion $script :dockerfileDataObject.SQLServerModuleMaxVersion @prodAllUsers
123
123
PowerShellGet\Install-Module - Name MicrosoftPowerBIMgmt - MaximumVersion $script :dockerfileDataObject.PowerBIMaxVersion @prodAllUsers
124
- PowerShellGet\Install-Module - Name MicrosoftTeams @prodAllUsers
124
+ PowerShellGet\Install-Module - Name MicrosoftTeams @prodAllUsers
125
125
126
126
# MS Graph packages
127
127
PowerShellGet\Install-Module - Name Microsoft.Graph.Authentication @prodAllUsers
@@ -142,25 +142,25 @@ try {
142
142
# Installing modules from Azure Powershell and AzureAD
143
143
Write-Output " Installing modules from Azure Powershell and AzureAD"
144
144
Install-AzAndAzAdModules
145
-
145
+
146
146
# Install modules from PSGallery
147
- Write-Output " Installing modules from production gallery"
148
- PowerShellGet\Install-Module - Name AzurePSDrive @prodAllUsers
147
+ Write-Output " Installing modules from production gallery"
148
+ PowerShellGet\Install-Module - Name AzurePSDrive @prodAllUsers
149
149
PowerShellGet\Install-Module - Name GuestConfiguration - MaximumVersion $script :dockerfileDataObject.GuestConfigurationMaxVersion - ErrorAction SilentlyContinue @prodAllUsers
150
150
PowerShellGet\Install-Module - Force PSReadLine @prodAllUsers
151
151
PowerShellGet\Install-Module - Name Az.Tools.Predictor @prodAllUsers
152
152
PowerShellGet\Install-Module - Name ExchangeOnlineManagement @prodAllUsers
153
153
PowerShellGet\Install-Module - Name Microsoft.PowerShell.SecretManagement @prodAllUsers
154
154
PowerShellGet\Install-Module - Name Microsoft.PowerShell.SecretStore @prodAllUsers
155
155
156
- # With older base image builds, teams 1.1.6 is already installed
156
+ # With older base image builds, teams 1.1.6 is already installed
157
157
if (Get-Module MicrosoftTeams - ListAvailable) {
158
158
# For some odd reason, Update-Module was creating the MicrosoftTeams module twice with different version numbers.
159
- # Uninstalling and then installing it again was the only way to keep it as one module.
159
+ # Uninstalling and then installing it again was the only way to keep it as one module.
160
160
Uninstall-Module MicrosoftTeams - Force
161
161
PowerShellGet\Install-Module - Name MicrosoftTeams @prodAllUsers
162
162
} else {
163
- PowerShellGet\Install-Module - Name MicrosoftTeams @prodAllUsers
163
+ PowerShellGet\Install-Module - Name MicrosoftTeams @prodAllUsers
164
164
}
165
165
166
166
# Install PSCloudShell modules
@@ -171,14 +171,14 @@ try {
171
171
Write-Output (' Temp Directory: {0}' -f $tempDirectory )
172
172
}
173
173
174
- # Copy the startup script to the all-users profile
174
+ # Copy the startup script to the all-users profile
175
175
$psStartupScript = Microsoft.PowerShell.Management\Join-Path $PSHOME ' PSCloudShellStartup.ps1'
176
176
Microsoft.PowerShell.Management\Copy-Item - Path $PSScriptRoot \PSCloudShellStartup.ps1 - Destination $psStartupScript
177
-
177
+
178
178
Write-Output " Installing powershell profile to $ ( $PROFILE.AllUsersAllHosts ) "
179
179
Microsoft.PowerShell.Management\Copy-Item - Path $psStartupScript - Destination $PROFILE.AllUsersAllHosts - Verbose
180
180
Write-Output " Installed powershell profile."
181
-
181
+
182
182
# Update PowerShell Core help files in the image, ensure any errors that result in help not being updated does not interfere with the build process
183
183
# We want the image to have latest help files when shipped.
184
184
Write-Output " Updating help files."
@@ -187,7 +187,7 @@ try {
187
187
}
188
188
189
189
Write-Output " All modules installed:"
190
- Write-Output (Get-InstalledModule | Sort-Object Name | Select-Object Name, Version, Repository)
190
+ Write-Output (Get-InstalledModule | Sort-Object Name | Select-Object Name, Version, Repository)
191
191
}
192
192
finally {
193
193
# Clean-up the PowerShell Gallery registration settings
0 commit comments