From 0907a27f2f3661028e3169af7b1ce6a5722087ee Mon Sep 17 00:00:00 2001 From: Tim Date: Sat, 31 Dec 2022 14:45:49 +0100 Subject: [PATCH] =?UTF-8?q?Typ=20korrigiert.=20-e=20f=C3=BCr=20winget=20li?= =?UTF-8?q?st?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install.ps1 | 18 +++++++++++++++--- profile.ps1 | 2 +- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/install.ps1 b/install.ps1 index 06fcfb3..6b88b5d 100644 --- a/install.ps1 +++ b/install.ps1 @@ -77,7 +77,7 @@ do { } # Software installieren. foreach ($utility in $toInstall) { - $ergebnis = winget list --id $utility + $ergebnis = winget list --id -e $utility if ($ergebnis -eq "Es wurde kein installiertes Paket gefunden, das den Eingabekriterien entspricht.") { Try { winget install -e --id $utility --silent @@ -166,7 +166,7 @@ do { Write-Host "Probleme beim verlinken der Powershell config." -ForegroundColor Red } } - elseif ((Test-Path "~/Documents/WindowsPowerShell/profile.ps1" -PathType Leaf) -eq $True) { + if ((Test-Path "~/Documents/WindowsPowerShell/profile.ps1" -PathType Leaf) -eq $True) { Remove-Item -Force "~/Documents/WindowsPowerShell/profile.ps1" Write-Host "Powershell config erfolgreich gelöscht." -ForegroundColor Green Try { @@ -176,8 +176,20 @@ do { Catch { Write-Host "Probleme beim verlinken der Powershell config." -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 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 erfolgreich verlinkt." + } + Catch { + Write-Host "Probleme beim verlinken der Powershell config." -ForegroundColor Red + } + } # 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 diff --git a/profile.ps1 b/profile.ps1 index 8aa9f81..de560bf 100644 --- a/profile.ps1 +++ b/profile.ps1 @@ -1,4 +1,4 @@ -# Lädt Funktionen aus der Ffunctions.ps1 +# Lädt Funktionen aus der functions.ps1 Get-ChildItem ~/.winconfig/functions.ps1 | %{. $_ } | out-null Get-ChildItem ~/.winconfig/aliases.ps1 | %{. $_ } | out-null