-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathConfig.ps1
More file actions
36 lines (30 loc) · 1.3 KB
/
Config.ps1
File metadata and controls
36 lines (30 loc) · 1.3 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
#Requires -RunAsAdministrator
# Defining PSGallery as a trusted repository.
if((Get-PSRepository -Name PSGallery).InstallationPolicy -ne 'Trusted'){
Set-PSRepository -Name PSGallery -InstallationPolicy Trusted
}
# Installing package provider.
$PackageProviders = 'NuGet'
foreach($PackageProvider in $PackageProviders){
Install-PackageProvider -Name $PackageProvider -Force
}
# Installing modules.
$Modules = 'Terminal-Icons','PSWindowsUpdate'
foreach($Module in $Modules){
Install-Module -Name $Module -Force
}
# Copying VIM configuration
Copy-Item .\.vimrc $HOME
# Setting up PowerShell profile.
## OhMyPosh installation.
winget install --exact --id JanDeDobbeleer.OhMyPosh --accept-source-agreements --accept-package-agreements
## Profile download from GitHub repository.
$ProfileUrl = 'https://raw.githubusercontent.com/AlCpwnd/TerminalConfiguration/main/PSProfile.ps1'
Invoke-WebRequest -Uri $ProfileUrl -UseBasicParsing -OutFile $PROFILE
# Configures Windows Terminal settings.
$SettingsPath = (Get-ChildItem -Path $env:LOCALAPPDATA\Packages\Microsoft.WindowsTerminal_*\LocalState\settings.json).FullName
if($SettingsPath){
Copy-Item -Path .\setting.json -Destination $SettingsPath -Force
}else{
Write-Host 'Failed to find existing settings file. Please configure it manually.' -ForegroundColor Red
}