Profil aufjeden fall anlegen.

This commit is contained in:
2022-12-31 16:08:45 +01:00
parent 40b0bd081a
commit c7e0c5f755

View File

@@ -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 {