New and Shiny

This commit is contained in:
2022-12-30 18:42:24 +01:00
parent 19940469b6
commit b02e406305

View File

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