Terminal gefixt.

This commit is contained in:
2023-07-11 14:22:07 +02:00
parent 98d46870d1
commit d0e67c5d92

View File

@@ -59,7 +59,7 @@ function InstallSoftware {
} }
} }
else { else {
if (CheckForLink(~\AppData\Local\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\settings.json) -eq $False) { if (CheckForLink("~\AppData\Local\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\settings.json") -eq $False) {
Write-Host "Lege Winget config an." -ForegroundColor Blue Write-Host "Lege Winget config an." -ForegroundColor Blue
Remove-Item "~\AppData\Local\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\settings.json" Remove-Item "~\AppData\Local\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\settings.json"
try { try {
@@ -139,7 +139,7 @@ function InstallSoftware {
} }
# Windows Terminal Settings # Windows Terminal Settings
Write-Host "Richte Windows Terminal config ein..." -ForegroundColor Blue Write-Host "Richte Windows Terminal config ein..." -ForegroundColor Blue
if (CheckForLink(~\AppData\Local\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState\settings.json) -eq $False) { if (CheckForLink("~\AppData\Local\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState\settings.json") -eq $False) {
Try { 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 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 Write-Host "Windows Terminal config erfolgreich eingerichtet" -ForegroundColor Green
@@ -177,29 +177,29 @@ function InstallSoftware {
Write-Host "Probleme beim installieren von Winfetch" -ForegroundColor Red Write-Host "Probleme beim installieren von Winfetch" -ForegroundColor Red
} }
} }
if (CheckForLink(~/.config/winfetch/config.ps1) -eq $False) { if (CheckForLink("~/.config/winfetch/config.ps1") -eq $False) {
Remove-Item "~/.config/winfetch/config.ps1" Remove-Item "~/.config/winfetch/config.ps1"
New-Item -Path "~/.config/winfetch/config.ps1" -ItemType SymbolicLink -Value "~/.winconfig/configs/winfetch/config.ps1" | Out-Null New-Item -Path "~/.config/winfetch/config.ps1" -ItemType SymbolicLink -Value "~/.winconfig/configs/winfetch/config.ps1" | Out-Null
} }
# Powershell Profile Datei erzeugen # Powershell Profile Datei erzeugen
Write-Host "Löschen des default Powershell profiles..." -ForegroundColor Blue Write-Host "Löschen des default Powershell profiles..." -ForegroundColor Blue
if ((Test-Path "~/Documents/PowerShell/profile.ps1" -PathType Leaf) -eq $True) { if ((Test-Path "~/Documents/PowerShell/profile.ps1" -PathType Leaf) -eq $True) {
if (CheckForLink(~/Documents/PowerShell/profile.ps1) -eq $False) { mkdir "~/Documents/PowerShell/"
Remove-Item -Force "~/Documents/PowerShell/profile.ps1" Remove-Item -Force "~/Documents/PowerShell/profile.ps1"
Write-Host "Powershell config ~/Documents/PowerShell/profile.ps1 erfolgreich gelöscht." -ForegroundColor Green Write-Host "Powershell config ~/Documents/PowerShell/profile.ps1 erfolgreich gelöscht." -ForegroundColor Green
}
Try { Try {
New-Item -Path "~/Documents/PowerShell/profile.ps1" -ItemType SymbolicLink -Value "~/.winconfig/profile.ps1" | Out-Null New-Item -Path "~/Documents/PowerShell/profile.ps1" -ItemType SymbolicLink -Value "~/.winconfig/profile.ps1" | Out-Null
mkdir "~/Documents/PowerShell/"
Write-Host "Powershell config ~/Documents/PowerShell/profile.ps1 erfolgreich verlinkt." Write-Host "Powershell config ~/Documents/PowerShell/profile.ps1 erfolgreich verlinkt."
} }
Catch { Catch {
Write-Host "Probleme beim verlinken der Powershell config ~/Documents/PowerShell/profile.ps1 " -ForegroundColor Red 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) { if ((Test-Path "~/Documents/WindowsPowerShell/profile.ps1" -PathType Leaf) -eq $True) {
if (CheckForLink(~/Documents/WindowsPowerShell/profile.ps1) -eq $False) {
Remove-Item -Force "~/Documents/WindowsPowerShell/profile.ps1" Remove-Item -Force "~/Documents/WindowsPowerShell/profile.ps1"
Write-Host "Powershell config ~/Documents/WindowsPowerShell/profile.ps1 erfolgreich gelöscht." -ForegroundColor Green Write-Host "Powershell config ~/Documents/WindowsPowerShell/profile.ps1 erfolgreich gelöscht." -ForegroundColor Green
}
Try { Try {
New-Item -Path "~/Documents/WindowsPowerShell/profile.ps1" -ItemType SymbolicLink -Value "~/.winconfig/profile.ps1" | Out-Null 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." Write-Host "Powershell config ~/Documents/WindowsPowerShell/profile.ps1 erfolgreich verlinkt."
@@ -207,12 +207,10 @@ function InstallSoftware {
Catch { Catch {
Write-Host "Probleme beim verlinken der Powershell config ~/Documents/WindowsPowerShell/profile.ps1" -ForegroundColor Red 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) { if ((Test-Path "~/Documents/WindowsPowerShell/Microsoft.PowerShell_profile.ps1" -PathType Leaf) -eq $True) {
if (CheckForLink("~/Documents/WindowsPowerShell/Microsoft.PowerShell_profile.ps1") -eq $True) {
Remove-Item -Force "~/Documents/WindowsPowerShell/Microsoft.PowerShell_profile.ps1" Remove-Item -Force "~/Documents/WindowsPowerShell/Microsoft.PowerShell_profile.ps1"
Write-Host "Powershell ~/Documents/WindowsPowerShell/Microsoft.PowerShell_profile.ps1 config erfolgreich gelöscht." -ForegroundColor Green Write-Host "Powershell ~/Documents/WindowsPowerShell/Microsoft.PowerShell_profile.ps1 config erfolgreich gelöscht." -ForegroundColor Green
}
Try { Try {
New-Item -Path "~\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1" -ItemType SymbolicLink -Value "~/.winconfig/profile.ps1" | Out-Null 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." Write-Host "Powershell config ~/Documents/WindowsPowerShell/Microsoft.PowerShell_profile.ps1 erfolgreich verlinkt."
@@ -220,8 +218,6 @@ function InstallSoftware {
Catch { Catch {
Write-Host "Probleme beim verlinken der Powershell config ~/Documents/WindowsPowerShell/Microsoft.PowerShell_profile.ps1 ." -ForegroundColor Red Write-Host "Probleme beim verlinken der Powershell config ~/Documents/WindowsPowerShell/Microsoft.PowerShell_profile.ps1 ." -ForegroundColor Red
} }
}
}
# Autohotkey in Startup # Autohotkey in Startup
Write-Host "Verlinke AutoHokey Scripts ..." -ForegroundColor Blue Write-Host "Verlinke AutoHokey Scripts ..." -ForegroundColor Blue
$sourceDir = "~\.winconfig\configs\autohotkey" $sourceDir = "~\.winconfig\configs\autohotkey"
@@ -231,6 +227,21 @@ function InstallSoftware {
New-Item -ItemType SymbolicLink -Path $linkPath -Target $_.FullName -ErrorAction SilentlyContinue | Out-Null New-Item -ItemType SymbolicLink -Path $linkPath -Target $_.FullName -ErrorAction SilentlyContinue | Out-Null
} }
Write-Host "AutoHotkey Scripts erfolgreich installiert." -ForegroundColor Green Write-Host "AutoHotkey Scripts erfolgreich installiert." -ForegroundColor Green
# Powershell Modul für PSReadline (oh-my-posh abhängigkeit)
if (Get-Module -ListAvailable -Name PSReadLine ) {
Write-Hoste "Windows Update Powershell Modul ist bereits installiert." -ForegroundColor Blue
}
else {
Write-Host "Beginne mit der Insallation des Powershell Update Modul..." -ForegroundColor Blue
Try {
Install-Module Install-Module PSReadLine -Force
Write-Host "Powershell update Modul erfolgreich installiert..." -ForegroundColor Green
}
Catch {
Write-Host "Fehler beim installieren des Powershell update Modul." -ForegroundColor Red
}
}
# Powershell Modul für Updates # Powershell Modul für Updates
if (Get-Module -ListAvailable -Name PSWindowsUpdate) { if (Get-Module -ListAvailable -Name PSWindowsUpdate) {
Write-Hoste "Windows Update Powershell Modul ist bereits installiert." -ForegroundColor Blue Write-Hoste "Windows Update Powershell Modul ist bereits installiert." -ForegroundColor Blue