From 44da658d0b92b91ef4c258f8d0aec89d35b7cb3d Mon Sep 17 00:00:00 2001 From: Tim Date: Sat, 10 Jun 2023 23:23:12 +0200 Subject: [PATCH] Updatet nun auch VSC Addons --- config.ps1 | 2 +- functions.ps1 | 37 +++++++++++++++++++++++++++---------- 2 files changed, 28 insertions(+), 11 deletions(-) diff --git a/config.ps1 b/config.ps1 index 6ca3bfd..04723b2 100644 --- a/config.ps1 +++ b/config.ps1 @@ -111,7 +111,7 @@ function InstallSoftware { Write-Host "Konfiguriere OOshutup10 bitte warten..." -ForegroundColor Blue Try { Write-Host "Versuche OOshutup10 config einzulesen..." -ForegroundColor Blue - ./OOSU10.exe $HOME\.winconfig\configs\ooshutup10\ooshutup10.cfg /quiet + shutup10 $HOME\.winconfig\configs\ooshutup10\ooshutup10.cfg /quiet Write-Host "OOshutup10 config erfolgreich eingelesen." -ForegroundColor Green } Catch { diff --git a/functions.ps1 b/functions.ps1 index 7b517fe..7e31e62 100644 --- a/functions.ps1 +++ b/functions.ps1 @@ -3,22 +3,39 @@ function allupdates { Write-Host "Beginne mit dem Update aller Pakete..." -ForegroundColor Blue winget upgrade --all Remove-Item C:\Users\Public\Desktop\*.lnk + Write-Host "Ziehe aktuelle winconfig von git..." -ForegroundColor Blue + Set-Location $HOME/.winconfig ; git pull + Write-Host "Aktuallisiere AutoHokey Scripts ..." -ForegroundColor Blue + $sourceDir = "$HOME\.winconfig\configs\autohotkey" + $targetDir = "$HOME\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup" + Get-ChildItem -Path $targetDir -Filter *.ahk -Recurse | Remove-Item -Force -ErrorAction SilentlyContinue + Get-ChildItem -Path $sourceDir | ForEach-Object { + $linkPath = Join-Path $targetDir $_.Name + New-Item -ItemType SymbolicLink -Path $linkPath -Target $_.FullName -ErrorAction SilentlyContinue | Out-Null + } + Write-Host "Beginne mit dem Update von VSC Extensions..." -ForegroundColor Blue + $GetExtension = code --list-extensions + foreach ($extension in $GetExtension ) { + Write-Host "Suche Update nach Extension $extension ..." -ForegroundColor Blue + try { + if (code --install-extension $extension --force | Select-String -Pattern "is already installed.") { + Write-Host "Extension $extension bereits aktuell." -ForegroundColor Blue + } + else { + Write-Host "Extension $extension erfolgreich aktualisiert." -ForegroundColor Green + } + } + catch { + Write-Host "Probleme beim Update der Extension $extension" -ForegroundColor Red + } + } if (Get-Module -ListAvailable -Name PSWindowsUpdate) { Write-Host "Installiere Windows Updates..." -ForegroundColor Blue Install-WindowsUpdate -MicrosoftUpdate -AcceptAll -IgnoreReboot # ooshutup10 ausführen. Manchmal werden settings nach Windos updates zurückgesetzt Write-Host "Spiele aktuelle OOSHUTUP10 config ein... " -ForegroundColor Blue Set-Location $HOME/.winconfig ; ./OOSU10.exe configs/ooshutup10/ooshutup10.cfg /quiet - Write-Host "Ziehe aktuelle winconfig von git..." -ForegroundColor Blue - Set-Location $HOME/.winconfig ; git pull - Write-Host "Aktuallisiere AutoHokey Scripts ..." -ForegroundColor Blue - $sourceDir = "$HOME\.winconfig\configs\autohotkey" - $targetDir = "$HOME\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup" - Get-ChildItem -Path $targetDir -Filter *.ahk -Recurse | Remove-Item -Force -ErrorAction SilentlyContinue - Get-ChildItem -Path $sourceDir | ForEach-Object { - $linkPath = Join-Path $targetDir $_.Name - New-Item -ItemType SymbolicLink -Path $linkPath -Target $_.FullName -ErrorAction SilentlyContinue | Out-Null - } + Write-Host "Update aller Powershell Module..." -ForegroundColor Blue Write-Host -ForegroundColor Blue 'Get all PowerShell modules' function Remove-OldPowerShellModules {