Update Funktion angepasst.

This commit is contained in:
2022-12-31 11:24:30 +01:00
parent b02e406305
commit 483846aaaa

View File

@@ -1,22 +1,21 @@
#Updatet all the things
function Update {
Write-Host "Beginne mit dem Update aller Pakete..."
Das gute Write-Host "Beginne mit dem Update aller Pakete..."
# Winget upgrades ausführen
winget upgrade --all
# ooshutup10 ausführen. Manchmal werden settings nach Windos updates zurückgesetzt
./OOSU10.exe $HOME/.winconfig/ooshutup10/ooshutup10.cfg /quiet
remove-item ~\Desktop* -include *.lnk
if (Get-Module -ListAvailable -Name PSWindowsUpdate) {
Write-Host "Installiere Windows Updates..."
Install-WindowsUpdate -MicrosoftUpdate -AcceptAll -IgnoreReboot
Write-Host "Update aller Powershell Module..."
if ($SimulationMode) {
Write-Host -ForegroundColor yellow 'Simulation mode is ON, nothing will be installed / removed / updated'
}
Write-Host -ForegroundColor Cyan 'Get all PowerShell modules'
function Remove-OldPowerShellModules {
param (
[string]$ModuleName,
[string]$GalleryVersion
)
try {
$oldVersions = Get-InstalledModule -Name $ModuleName -AllVersions -ErrorAction Stop | Where-Object { $_.Version -ne $GalleryVersion }