Windows Terminal anpassung verbessert.
This commit is contained in:
201
install.ps1
201
install.ps1
@@ -8,6 +8,18 @@ if (-NOT ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdenti
|
||||
Break
|
||||
}
|
||||
|
||||
# Funktion um zu prüfen ob die config Files schon vorhanden sind.
|
||||
function CheckForLink ($Path) {
|
||||
|
||||
if (((Get-Item $Path).LinkType -eq "SymbolicLink")) {
|
||||
Return $True
|
||||
}
|
||||
else {
|
||||
Return $False
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
# Konfig für die prompts
|
||||
$choices = New-Object Collections.ObjectModel.Collection[Management.Automation.Host.ChoiceDescription]
|
||||
$choices.Add((New-Object Management.Automation.Host.ChoiceDescription -ArgumentList '&Yes'))
|
||||
@@ -65,15 +77,18 @@ do {
|
||||
}
|
||||
}
|
||||
else {
|
||||
Write-Host "Lege Winget config an." -ForegroundColor Blue
|
||||
Remove-Item "~\AppData\Local\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\settings.json"
|
||||
try {
|
||||
New-Item -Path "~\AppData\Local\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\settings.json" -ItemType SymbolicLink -Value "~/.winconfig/configs/winget/settings.json" | Out-Null
|
||||
Write-Host "Winget config erfolgreich verlinkt." -ForegroundColor Green
|
||||
}
|
||||
catch {
|
||||
Write-Host "Probleme beim verlinken der Wignet configt" -ForegroundColor Red
|
||||
}
|
||||
if (CheckForLink(~\AppData\Local\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\settings.json) -eq $False) {
|
||||
Write-Host "Lege Winget config an." -ForegroundColor Blue
|
||||
Remove-Item "~\AppData\Local\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\settings.json"
|
||||
try {
|
||||
New-Item -Path "~\AppData\Local\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\settings.json" -ItemType SymbolicLink -Value "~/.winconfig/configs/winget/settings.json" | Out-Null
|
||||
Write-Host "Winget config erfolgreich verlinkt." -ForegroundColor Green
|
||||
}
|
||||
catch {
|
||||
Write-Host "Probleme beim verlinken der Wignet configt" -ForegroundColor Red
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
# Software installieren.
|
||||
foreach ($utility in $toInstall) {
|
||||
@@ -123,106 +138,103 @@ do {
|
||||
}
|
||||
# Windows Terminal Settings
|
||||
Write-Host "Richte Windows Terminal config ein..." -ForegroundColor Blue
|
||||
Try {
|
||||
Remove-Item "~\AppData\Local\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState\settings.json" ; New-Item -Path "~\AppData\Local\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState\settings.json" -ItemType SymbolicLink -Value "~/.winconfig/configs/terminal/settings.json" | Out-Null
|
||||
Write-Host "Windows Terminal config erfolgreich eingerichtet" -ForegroundColor Green
|
||||
}
|
||||
Catch {
|
||||
Write-Host "Fehler beim einrichten der Windows Terminal config." -ForegroundColor Red
|
||||
}
|
||||
# Winfetch installieren & konfigurieren
|
||||
Write-Host "Installiere und konfiguriere Winfetch..." -ForegroundColor Blue
|
||||
Try {
|
||||
Install-Script winfetch
|
||||
Write-Host "Winfetch erfolgreich installiert." -ForegroundColor Green
|
||||
if ((Test-Path ~/.config/winfetch -PathType Leaf) -eq $True) {
|
||||
Write-Host "Lösche default config..." -ForegroundColor Blue
|
||||
Remove-Item -Recurse -Force ~/.config/winfetch
|
||||
}
|
||||
Write-Host "Lege Winfetch config Ordner an..." -ForegroundColor Blue
|
||||
mkdir ~/.config/winfetch | Out-Null
|
||||
Write-Host "Winfetch config Ordner erfolgreich angelegt!" -ForegroundColor Green
|
||||
if (CheckForLink(~\AppData\Local\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState\settings.json) -eq $False) {
|
||||
Try {
|
||||
New-Item -Path "~/.config/winfetch/config.ps1" -ItemType SymbolicLink -Value "~/.winconfig/configs/winfetch/config.ps1" | Out-Null
|
||||
Write-Host "Winfetch config sauber gelinkt." -ForegroundColor Green
|
||||
Remove-Item "~\AppData\Local\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState\settings.json" ; New-Item -Path "~\AppData\Local\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState\settings.json" -ItemType SymbolicLink -Value "~/.winconfig/configs/terminal/settings.json" | Out-Null
|
||||
Write-Host "Windows Terminal config erfolgreich eingerichtet" -ForegroundColor Green
|
||||
}
|
||||
Catch {
|
||||
Write-Host "Probleme beim verlinken der Winfetch config" -ForegroundColor Red
|
||||
Write-Host "Fehler beim einrichten der Windows Terminal config." -ForegroundColor Red
|
||||
}
|
||||
}
|
||||
# Winfetch installieren & konfigurieren
|
||||
|
||||
if (Get-Module -ListAvailable -Name winfetch) {
|
||||
Write-Host "Winfetch ist bereits installiert." -ForegroundColor Blue
|
||||
}
|
||||
else {
|
||||
Write-Host "Installiere und konfiguriere Winfetch..." -ForegroundColor Blue
|
||||
Try {
|
||||
Install-Script winfetch
|
||||
Write-Host "Winfetch erfolgreich installiert." -ForegroundColor Green
|
||||
if ((Test-Path ~/.config/winfetch -PathType Leaf) -eq $True) {
|
||||
Write-Host "Lösche default config..." -ForegroundColor Blue
|
||||
Remove-Item -Recurse -Force ~/.config/winfetch
|
||||
}
|
||||
Write-Host "Lege Winfetch config Ordner an..." -ForegroundColor Blue
|
||||
mkdir ~/.config/winfetch | Out-Null
|
||||
Write-Host "Winfetch config Ordner erfolgreich angelegt!" -ForegroundColor Green
|
||||
Try {
|
||||
New-Item -Path "~/.config/winfetch/config.ps1" -ItemType SymbolicLink -Value "~/.winconfig/configs/winfetch/config.ps1" | Out-Null
|
||||
Write-Host "Winfetch config sauber gelinkt." -ForegroundColor Green
|
||||
}
|
||||
Catch {
|
||||
Write-Host "Probleme beim verlinken der Winfetch config" -ForegroundColor Red
|
||||
}
|
||||
}
|
||||
Catch {
|
||||
Write-Host "Probleme beim installieren von Winfetch" -ForegroundColor Red
|
||||
}
|
||||
}
|
||||
Catch {
|
||||
Write-Host "Probleme beim installieren von Winfetch" -ForegroundColor Red
|
||||
}
|
||||
if (CheckForLink(~/.config/winfetch/config.ps1) -eq $False) {
|
||||
Remove-Item "~/.config/winfetch/config.ps1"
|
||||
New-Item -Path "~/.config/winfetch/config.ps1" -ItemType SymbolicLink -Value "~/.winconfig/configs/winfetch/config.ps1" | Out-Null
|
||||
}
|
||||
# Powershell Profile Datei erzeugen
|
||||
Write-Host "Löschen des default Powershell profiles..." -ForegroundColor Blue
|
||||
if ((Test-Path "~/Documents/PowerShell/profile.ps1" -PathType Leaf) -eq $True) {
|
||||
Remove-Item -Force "~/Documents/PowerShell/profile.ps1"
|
||||
Write-Host "Powershell config ~/Documents/PowerShell/profile.ps1 erfolgreich gelöscht." -ForegroundColor Green
|
||||
Try {
|
||||
New-Item -Path "~/Documents/PowerShell/profile.ps1" -ItemType SymbolicLink -Value "~/.winconfig/profile.ps1" | Out-Null
|
||||
Write-Host "Powershell config ~/Documents/PowerShell/profile.ps1 erfolgreich verlinkt."
|
||||
}
|
||||
Catch {
|
||||
Write-Host "Probleme beim verlinken der Powershell config ~/Documents/PowerShell/profile.ps1 " -ForegroundColor Red
|
||||
}
|
||||
}
|
||||
else {
|
||||
Try {
|
||||
New-Item -Path "~/Documents/PowerShell/profile.ps1" -ItemType SymbolicLink -Value "~/.winconfig/profile.ps1" | Out-Null
|
||||
Write-Host "Powershell config ~/Documents/PowerShell/profile.ps1 erfolgreich verlinkt."
|
||||
}
|
||||
Catch {
|
||||
Write-Host "Probleme beim verlinken der Powershell config ~/Documents/PowerShell/profile.ps1 " -ForegroundColor Red
|
||||
if (CheckForLink(~/Documents/PowerShell/profile.ps1) -eq $False) {
|
||||
Remove-Item -Force "~/Documents/PowerShell/profile.ps1"
|
||||
Write-Host "Powershell config ~/Documents/PowerShell/profile.ps1 erfolgreich gelöscht." -ForegroundColor Green
|
||||
Try {
|
||||
New-Item -Path "~/Documents/PowerShell/profile.ps1" -ItemType SymbolicLink -Value "~/.winconfig/profile.ps1" | Out-Null
|
||||
Write-Host "Powershell config ~/Documents/PowerShell/profile.ps1 erfolgreich verlinkt."
|
||||
}
|
||||
Catch {
|
||||
Write-Host "Probleme beim verlinken der Powershell config ~/Documents/PowerShell/profile.ps1 " -ForegroundColor Red
|
||||
}
|
||||
}
|
||||
}
|
||||
if ((Test-Path "~/Documents/WindowsPowerShell/profile.ps1" -PathType Leaf) -eq $True) {
|
||||
Remove-Item -Force "~/Documents/WindowsPowerShell/profile.ps1"
|
||||
Write-Host "Powershell config ~/Documents/WindowsPowerShell/profile.ps1 erfolgreich gelöscht." -ForegroundColor Green
|
||||
Try {
|
||||
New-Item -Path "~/Documents/PowerShell/profile.ps1" -ItemType SymbolicLink -Value "~/.winconfig/profile.ps1" | Out-Null
|
||||
Write-Host "Powershell config ~/Documents/WindowsPowerShell/profile.ps1 erfolgreich verlinkt."
|
||||
}
|
||||
Catch {
|
||||
Write-Host "Probleme beim verlinken der Powershell config ~/Documents/PowerShell/profile.ps1" -ForegroundColor Red
|
||||
}
|
||||
}
|
||||
else {
|
||||
Try {
|
||||
New-Item -Path "~/Documents/PowerShell/profile.ps1" -ItemType SymbolicLink -Value "~/.winconfig/profile.ps1" | Out-Null
|
||||
Write-Host "Powershell config ~/Documents/WindowsPowerShell/profile.ps1 erfolgreich verlinkt."
|
||||
}
|
||||
Catch {
|
||||
Write-Host "Probleme beim verlinken der Powershell config ~/Documents/PowerShell/profile.ps1" -ForegroundColor Red
|
||||
if (CheckForLink(~/Documents/WindowsPowerShell/profile.ps1) -eq $False) {
|
||||
Remove-Item -Force "~/Documents/WindowsPowerShell/profile.ps1"
|
||||
Write-Host "Powershell config ~/Documents/WindowsPowerShell/profile.ps1 erfolgreich gelöscht." -ForegroundColor Green
|
||||
Try {
|
||||
New-Item -Path "~/Documents/WindowsPowerShell/profile.ps1" -ItemType SymbolicLink -Value "~/.winconfig/profile.ps1" | Out-Null
|
||||
Write-Host "Powershell config ~/Documents/WindowsPowerShell/profile.ps1 erfolgreich verlinkt."
|
||||
}
|
||||
Catch {
|
||||
Write-Host "Probleme beim verlinken der Powershell config ~/Documents/WindowsPowerShell/profile.ps1" -ForegroundColor Red
|
||||
}
|
||||
}
|
||||
}
|
||||
if ((Test-Path "~/Documents/WindowsPowerShell/Microsoft.PowerShell_profile.ps1" -PathType Leaf) -eq $True) {
|
||||
Remove-Item -Force "~/Documents/WindowsPowerShell/Microsoft.PowerShell_profile.ps1"
|
||||
Write-Host "Powershell ~/Documents/WindowsPowerShell/Microsoft.PowerShell_profile.ps1 config erfolgreich gelöscht." -ForegroundColor Green
|
||||
Try {
|
||||
New-Item -Path "~\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1" -ItemType SymbolicLink -Value "~/.winconfig/profile.ps1" | Out-Null
|
||||
Write-Host "Powershell config ~/Documents/WindowsPowerShell/Microsoft.PowerShell_profile.ps1 erfolgreich verlinkt."
|
||||
if (CheckForLink("~/Documents/WindowsPowerShell/Microsoft.PowerShell_profile.ps1") -eq $True) {
|
||||
Remove-Item -Force "~/Documents/WindowsPowerShell/Microsoft.PowerShell_profile.ps1"
|
||||
Write-Host "Powershell ~/Documents/WindowsPowerShell/Microsoft.PowerShell_profile.ps1 config erfolgreich gelöscht." -ForegroundColor Green
|
||||
Try {
|
||||
New-Item -Path "~\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1" -ItemType SymbolicLink -Value "~/.winconfig/profile.ps1" | Out-Null
|
||||
Write-Host "Powershell config ~/Documents/WindowsPowerShell/Microsoft.PowerShell_profile.ps1 erfolgreich verlinkt."
|
||||
}
|
||||
Catch {
|
||||
Write-Host "Probleme beim verlinken der Powershell config ~/Documents/WindowsPowerShell/Microsoft.PowerShell_profile.ps1 ." -ForegroundColor Red
|
||||
}
|
||||
}
|
||||
Catch {
|
||||
Write-Host "Probleme beim verlinken der Powershell config ~/Documents/WindowsPowerShell/Microsoft.PowerShell_profile.ps1 ." -ForegroundColor Red
|
||||
}
|
||||
}
|
||||
else {
|
||||
Try {
|
||||
New-Item -Path "~\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1" -ItemType SymbolicLink -Value "~/.winconfig/profile.ps1" | Out-Null
|
||||
Write-Host "Powershell config ~/Documents/WindowsPowerShell/Microsoft.PowerShell_profile.ps1 erfolgreich verlinkt."
|
||||
}
|
||||
Catch {
|
||||
Write-Host "Probleme beim verlinken der Powershell config ~/Documents/WindowsPowerShell/Microsoft.PowerShell_profile.ps1 ." -ForegroundColor Red
|
||||
} <# Action when all if and elseif conditions are false #>
|
||||
}
|
||||
}
|
||||
# Powershell Modul für Updates
|
||||
Write-Host "Beginne mit der Insallation des Powershell Update Modul..." -ForegroundColor Blue
|
||||
Try {
|
||||
Install-Module -Name PSWindowsUpdate -Force
|
||||
Write-Host "Powershell update Modul erfolgreich installiert..." -ForegroundColor Green
|
||||
if (Get-Module -ListAvailable -Name PSWindowsUpdate) {
|
||||
Write-Hoste "Windows Update Powershell Modul ist bereits installiert." -ForegroundColor Blue
|
||||
}
|
||||
Catch {
|
||||
Write-Host "Fehler beim installieren des Powershell update Modul." -ForegroundColor Red
|
||||
else {
|
||||
|
||||
Write-Host "Beginne mit der Insallation des Powershell Update Modul..." -ForegroundColor Blue
|
||||
Try {
|
||||
Install-Module -Name PSWindowsUpdate -Force
|
||||
Write-Host "Powershell update Modul erfolgreich installiert..." -ForegroundColor Green
|
||||
}
|
||||
Catch {
|
||||
Write-Host "Fehler beim installieren des Powershell update Modul." -ForegroundColor Red
|
||||
}
|
||||
}
|
||||
Read-Host "Bitte das Terminal / Powershell neu starten damit die Aenderungen uebernommen werden."
|
||||
|
||||
@@ -255,11 +267,6 @@ do {
|
||||
New-ItemProperty -path 'HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced' -Name 'TaskbarSi' -value '0000001' -PropertyType DWORD
|
||||
Write-Host "Starte Explorer neu um änderungen zu übernehmen"
|
||||
Get-Process explorer | Stop-Process
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
pause
|
||||
|
||||
Reference in New Issue
Block a user