Skip to content

Commit f006ec4

Browse files
committed
setupPowerShell: Format the script
Signed-off-by: Suraj Deshmukh <[email protected]>
1 parent 222ea84 commit f006ec4

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

linux/powershell/setupPowerShell.ps1

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ param(
1010
$ProgressPreference = 'SilentlyContinue' # Suppresses progress, which doesn't render correctly in docker
1111

1212
# PowerShellGallery PROD site
13-
$prodGallery = 'https://www.powershellgallery.com/api/v2'
13+
$prodGallery = 'https://www.powershellgallery.com/api/v2'
1414

1515
$script:pscloudshellBlob = $null # Version folder for the pscloudshell blob storage
1616
$shareModulePath = ([System.Management.Automation.Platform]::SelectProductNameForDirectory('SHARED_MODULES'))
@@ -31,7 +31,7 @@ function Get-DockerfileData {
3131
$script:dockerfileDataObject = Microsoft.PowerShell.Management\Get-Content $dockerFileData | Microsoft.PowerShell.Utility\ConvertFrom-Json
3232
if (-not $script:dockerfileDataObject) {
3333
throw "Error while reading $dockerFileData file."
34-
}
34+
}
3535
$pscloudshellVer = $script:dockerfileDataObject.PSCloudShellVersion
3636
$script:pscloudshellBlob = "https://pscloudshellbuild.blob.core.windows.net/$pscloudshellVer"
3737
Write-Output "pscloudshellVersion= $pscloudshellVer; pscloudshellBlob=$script:pscloudshellBlob"
@@ -57,8 +57,8 @@ function Install-LibMIFile {
5757
function Install-AzAndAzAdModules {
5858
Write-Output "Install-AzAndAdModules.."
5959
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
6262
rm az-cmdlets.tar.gz
6363
cd temp
6464

@@ -118,10 +118,10 @@ try {
118118

119119
if ($image -eq "Base") {
120120
Write-Output "Installing modules from production gallery"
121-
PowerShellGet\Install-Module -Name SHiPS @prodAllUsers
121+
PowerShellGet\Install-Module -Name SHiPS @prodAllUsers
122122
PowerShellGet\Install-Module -Name SQLServer -MaximumVersion $script:dockerfileDataObject.SQLServerModuleMaxVersion @prodAllUsers
123123
PowerShellGet\Install-Module -Name MicrosoftPowerBIMgmt -MaximumVersion $script:dockerfileDataObject.PowerBIMaxVersion @prodAllUsers
124-
PowerShellGet\Install-Module -Name MicrosoftTeams @prodAllUsers
124+
PowerShellGet\Install-Module -Name MicrosoftTeams @prodAllUsers
125125

126126
# MS Graph packages
127127
PowerShellGet\Install-Module -Name Microsoft.Graph.Authentication @prodAllUsers
@@ -142,25 +142,25 @@ try {
142142
# Installing modules from Azure Powershell and AzureAD
143143
Write-Output "Installing modules from Azure Powershell and AzureAD"
144144
Install-AzAndAzAdModules
145-
145+
146146
# 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
149149
PowerShellGet\Install-Module -Name GuestConfiguration -MaximumVersion $script:dockerfileDataObject.GuestConfigurationMaxVersion -ErrorAction SilentlyContinue @prodAllUsers
150150
PowerShellGet\Install-Module -Force PSReadLine @prodAllUsers
151151
PowerShellGet\Install-Module -Name Az.Tools.Predictor @prodAllUsers
152152
PowerShellGet\Install-Module -Name ExchangeOnlineManagement @prodAllUsers
153153
PowerShellGet\Install-Module -Name Microsoft.PowerShell.SecretManagement @prodAllUsers
154154
PowerShellGet\Install-Module -Name Microsoft.PowerShell.SecretStore @prodAllUsers
155155

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
157157
if (Get-Module MicrosoftTeams -ListAvailable) {
158158
# 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.
160160
Uninstall-Module MicrosoftTeams -Force
161161
PowerShellGet\Install-Module -Name MicrosoftTeams @prodAllUsers
162162
} else {
163-
PowerShellGet\Install-Module -Name MicrosoftTeams @prodAllUsers
163+
PowerShellGet\Install-Module -Name MicrosoftTeams @prodAllUsers
164164
}
165165

166166
# Install PSCloudShell modules
@@ -171,14 +171,14 @@ try {
171171
Write-Output ('Temp Directory: {0}' -f $tempDirectory)
172172
}
173173

174-
# Copy the startup script to the all-users profile
174+
# Copy the startup script to the all-users profile
175175
$psStartupScript = Microsoft.PowerShell.Management\Join-Path $PSHOME 'PSCloudShellStartup.ps1'
176176
Microsoft.PowerShell.Management\Copy-Item -Path $PSScriptRoot\PSCloudShellStartup.ps1 -Destination $psStartupScript
177-
177+
178178
Write-Output "Installing powershell profile to $($PROFILE.AllUsersAllHosts)"
179179
Microsoft.PowerShell.Management\Copy-Item -Path $psStartupScript -Destination $PROFILE.AllUsersAllHosts -Verbose
180180
Write-Output "Installed powershell profile."
181-
181+
182182
# 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
183183
# We want the image to have latest help files when shipped.
184184
Write-Output "Updating help files."
@@ -187,7 +187,7 @@ try {
187187
}
188188

189189
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)
191191
}
192192
finally {
193193
# Clean-up the PowerShell Gallery registration settings

0 commit comments

Comments
 (0)