From b02e4063055129907f87078024bfb2ce1543e914 Mon Sep 17 00:00:00 2001 From: Tim Date: Fri, 30 Dec 2022 18:42:24 +0100 Subject: [PATCH] New and Shiny --- install.ps1 | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/install.ps1 b/install.ps1 index d17b293..c809522 100644 --- a/install.ps1 +++ b/install.ps1 @@ -1,5 +1,6 @@ # Log starten Start-Transcript -Path $HOME/.winconfig/run.log + ## Fragt nach Admin Rechten. if (-NOT ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) { $arguments = "& '" + $myinvocation.mycommand.definition + "'" @@ -7,7 +8,6 @@ if (-NOT ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdenti Break } - # Konfig für die prompts $choices = New-Object Collections.ObjectModel.Collection[Management.Automation.Host.ChoiceDescription] $choices.Add((New-Object Management.Automation.Host.ChoiceDescription -ArgumentList '&Yes')) @@ -24,9 +24,7 @@ $toInstall = @('mcmilk.7zip-zstd', 'VideoLAN.VLC', 'SumatraPDF.SumatraPDF', 'Mic $toInstallOpt = @('Element.Element', 'Discord.Discord', 'Corsair.iCUE.4', 'Valve.Steam', 'GOG.Galaxy', 'TeXstudio.TeXstudio', 'MiKTeX.MiKTeX', 'Citrix.Workspace', 'Nvidia.GeForceExperience', 'Mojang.MinecraftLauncher', 'Elgato.StreamDeck', 'REALiX.HWiNFO', '9P4CLT2RJ1RS', 'Oracle.VirtualBox') - - - +# Menü konfiguration function Show-Menu { param ( [string]$Title = 'Software installation' @@ -45,6 +43,7 @@ do { $selection = Read-Host "Bitte Aufgabe auswählen" switch ($selection) { '1' { + # Crap deinstallieren foreach ($utility in $toRemove) { Try { winget uninstall --id $utility @@ -136,7 +135,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 -PathType Leaf) -eq $True) { Write-Host "Lösche default config..." -ForegroundColor Blue Remove-Item -Recurse -Force ~/.config/winfetch } @@ -156,7 +155,7 @@ do { } # Powershell Profile Datei erzeugen Write-Host "Löschen des default Powershell profiles..." -ForegroundColor Blue - if (Test-Path "~/Documents/PowerShell/profile.ps1" -eq $True) { + if ((Test-Path "~/Documents/PowerShell/profile.ps1" -PathType Leaf) -eq $True) { Remove-Item -Force "~/Documents/PowerShell/profile.ps1" Write-Host "Powershell config erfolgreich gelöscht." -ForegroundColor Green Try { @@ -167,7 +166,7 @@ do { Write-Host "Probleme beim verlinken der Powershell config." -ForegroundColor Red } } - elseif (Test-Path "~/Documents/WindowsPowerShell/profile.ps1" -eq $True) { + elseif ((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 {