-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathInstall-ProfileModules.ps1
More file actions
36 lines (30 loc) · 1.1 KB
/
Copy pathInstall-ProfileModules.ps1
File metadata and controls
36 lines (30 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
[Diagnostics.CodeAnalysis.SuppressMessageAttribute(
'PSAvoidUsingWriteHost', '',
Justification = 'Interactive setup script; progress is meant for the host.')]
param()
# Each module is a hashtable with a Name and optional AllowPrerelease / RequiredVersion.
$modules = @(
@{ Name = 'git-completion' },
@{ Name = 'Pester' },
@{ Name = 'posh-git' },
@{ Name = 'PSBashCompletions' },
@{ Name = 'Terminal-Icons' },
# Pinned - the PowerShell extension 2025.x for VS Code doesn't work with 1.25.0.
@{ Name = 'PSScriptAnalyzer'; RequiredVersion = '1.24.0' }
)
Write-Host 'Installing modules - watch for warnings, you may need to install a module and include -Force to get side-by-side support.'
$modules | ForEach-Object {
$installParams = @{
Name = $_.Name
Scope = 'CurrentUser'
AllowClobber = $true
Force = $true
}
if ($_.AllowPrerelease) {
$installParams.AllowPrerelease = $true
}
if ($_.RequiredVersion) {
$installParams.RequiredVersion = $_.RequiredVersion
}
Install-Module @installParams
}