diff --git a/install.ps1 b/install.ps1 index 8ccbdc6..d17b293 100644 --- a/install.ps1 +++ b/install.ps1 @@ -55,7 +55,7 @@ do { } } '2' { # Winget config installieren. - if (-not(Test-Path -Path '~\AppData\Local\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\settings.json' -PathType leaf)){ + if (-not(Test-Path -Path '~\AppData\Local\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\settings.json' -PathType leaf)) { Write-Host "Lege Winget config an." -ForegroundColor Blue try { New-Item -Path "~\AppData\Local\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\settings.json" -ItemType SymbolicLink -Value "~/.winconfig/configs/winget/settings.json" | Out-Null @@ -92,12 +92,12 @@ do { } } # OOShutup10 herunterladen und config reinrendenr. - Write-Host "Lade OOshutup10 herunter bitte warten." -ForegroundColor Blue + Write-Host "Lade OOshutup10 herunter bitte warten..." -ForegroundColor Blue Try { curl.exe -s "https://dl5.oo-software.com/files/ooshutup10/OOSU10.exe" -o OOSU10.exe Write-Host "OOshutup10 erfolgreich heruntergeladen." -ForegroundColor Green Write-Host "Versuche OOshutup10 config einzulesen..." -ForegroundColor Blue - ./OOSU10.exe $HOME/.winconfig/ooshutup10.cfg /quiet + ./OOSU10.exe $HOME/.winconfig/ooshutup10/ooshutup10.cfg /quiet Write-Host "OOshutup10 config erfolgreich eingelesen." -ForegroundColor Green } Catch { @@ -136,7 +136,7 @@ do { Try { Install-Script winfetch Write-Host "Winfetch erfolgreich installiert." -ForegroundColor Green - if ((Test-Path ~/.config/winfetch) -eq $True){ + if ((Test-Path ~/.config/winfetch) -eq $True) { Write-Host "Lösche default config..." -ForegroundColor Blue Remove-Item -Recurse -Force ~/.config/winfetch } @@ -156,7 +156,7 @@ do { } # Powershell Profile Datei erzeugen Write-Host "Löschen des default Powershell profiles..." -ForegroundColor Blue - Try { + if (Test-Path "~/Documents/PowerShell/profile.ps1" -eq $True) { Remove-Item -Force "~/Documents/PowerShell/profile.ps1" Write-Host "Powershell config erfolgreich gelöscht." -ForegroundColor Green Try { @@ -164,12 +164,20 @@ do { Write-Host "Powershell config erfolgreich verlinkt." } Catch { - Write-Host "Probleme beim verlinken der Powershell config." + Write-Host "Probleme beim verlinken der Powershell config." -ForegroundColor Red } } - Catch { - Write-Host "Probleme beim löschen der default Powershell config." -ForegroundColor Red - } + elseif (Test-Path "~/Documents/WindowsPowerShell/profile.ps1" -eq $True) { + Remove-Item -Force "~/Documents/WindowsPowerShell/profile.ps1" + Write-Host "Powershell config 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 erfolgreich verlinkt." + } + Catch { + Write-Host "Probleme beim verlinken der Powershell config." -ForegroundColor Red + } + } # Powershell Modul für Updates Try { Install-Module -Name PSWindowsUpdate -Force