From c7e0c5f7553dfebff69a0dbb93ad5db1bd1bd5f2 Mon Sep 17 00:00:00 2001 From: Tim Date: Sat, 31 Dec 2022 16:08:45 +0100 Subject: [PATCH] Profil aufjeden fall anlegen. --- install.ps1 | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/install.ps1 b/install.ps1 index 2db9e8e..ba5cabe 100644 --- a/install.ps1 +++ b/install.ps1 @@ -166,6 +166,15 @@ do { 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 ((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 @@ -177,6 +186,15 @@ do { 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 ((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 @@ -187,7 +205,16 @@ do { 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 {