From 0f15be36f37054f1455a9aeb17fe32caccc0c024 Mon Sep 17 00:00:00 2001 From: Romain <96626929+Romanitho@users.noreply.github.com> Date: Mon, 2 Sep 2024 15:58:40 +0200 Subject: [PATCH 1/5] Move winget_system_apps.txt to \config folder --- .../Winget-AutoUpdate/functions/Get-WingetOutdatedApps.ps1 | 2 +- Sources/Winget-AutoUpdate/functions/Get-WingetSystemApps.ps1 | 2 +- .../Winget-AutoUpdate/functions/Invoke-PostUpdateActions.ps1 | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Sources/Winget-AutoUpdate/functions/Get-WingetOutdatedApps.ps1 b/Sources/Winget-AutoUpdate/functions/Get-WingetOutdatedApps.ps1 index bb1142a..e0f9284 100644 --- a/Sources/Winget-AutoUpdate/functions/Get-WingetOutdatedApps.ps1 +++ b/Sources/Winget-AutoUpdate/functions/Get-WingetOutdatedApps.ps1 @@ -68,7 +68,7 @@ function Get-WingetOutdatedApps { #If current user is not system, remove system apps from list if ($IsSystem -eq $false) { - $SystemApps = Get-Content -Path "$WorkingDir\winget_system_apps.txt" -ErrorAction SilentlyContinue + $SystemApps = Get-Content -Path "$WorkingDir\config\winget_system_apps.txt" -ErrorAction SilentlyContinue $upgradeList = $upgradeList | Where-Object { $SystemApps -notcontains $_.Id } } diff --git a/Sources/Winget-AutoUpdate/functions/Get-WingetSystemApps.ps1 b/Sources/Winget-AutoUpdate/functions/Get-WingetSystemApps.ps1 index 8f653ea..261bbd5 100644 --- a/Sources/Winget-AutoUpdate/functions/Get-WingetSystemApps.ps1 +++ b/Sources/Winget-AutoUpdate/functions/Get-WingetSystemApps.ps1 @@ -1,7 +1,7 @@ function Get-WingetSystemApps { #Json File, where to export system installed apps - $jsonFile = "$WorkingDir\winget_system_apps.txt" + $jsonFile = "$WorkingDir\config\winget_system_apps.txt" #Get list of installed Winget apps to json file & $Winget export -o $jsonFile --accept-source-agreements -s winget | Out-Null diff --git a/Sources/Winget-AutoUpdate/functions/Invoke-PostUpdateActions.ps1 b/Sources/Winget-AutoUpdate/functions/Invoke-PostUpdateActions.ps1 index fa3db58..00eb446 100644 --- a/Sources/Winget-AutoUpdate/functions/Invoke-PostUpdateActions.ps1 +++ b/Sources/Winget-AutoUpdate/functions/Invoke-PostUpdateActions.ps1 @@ -101,7 +101,9 @@ function Invoke-PostUpdateActions { "$WorkingDir\functions\Write-Log.ps1", "$WorkingDir\functions\Get-WinGetAvailableVersion.ps1", "$WorkingDir\functions\Invoke-ModsProtect.ps1", - "$WorkingDir\Version.txt" + "$WorkingDir\functions\Write-CMTraceLog.ps1", + "$WorkingDir\Version.txt", + "$WorkingDir\winget_system_apps.txt" ) foreach ($FileName in $FileNames) { if (Test-Path $FileName) { From 941ea6f2dc94c0147fd228b20960286b6a19a959 Mon Sep 17 00:00:00 2001 From: Romain <96626929+Romanitho@users.noreply.github.com> Date: Mon, 2 Sep 2024 16:10:21 +0200 Subject: [PATCH 2/5] auto format --- .github/.powershell-psscriptanalyzer.psd1 | 2 +- Sources/Winget-AutoUpdate/WAU-Policies.ps1 | 2 +- .../functions/Add-ScopeMachine.ps1 | 2 +- .../functions/Confirm-Installation.ps1 | 2 +- .../functions/Get-AZCopy.ps1 | 2 +- .../functions/Get-WAUAvailableVersion.ps1 | 2 +- .../functions/Get-WAUConfig.ps1 | 2 +- .../functions/Get-WingetCmd.ps1 | 2 +- .../functions/Install-Prerequisites.ps1 | 2 +- .../functions/Invoke-DirProtect.ps1 | 2 +- .../functions/Test-ListPath.ps1 | 2 +- .../functions/Test-Network.ps1 | 8 ++- .../functions/Update-App.ps1 | 2 +- .../functions/Write-ToLog.ps1 | 2 +- .../mods/_AppID-template.ps1 | 4 +- .../mods/_Mods-Functions.ps1 | 72 +++++++------------ .../mods/_WAU-notinstalled-template.ps1 | 6 +- 17 files changed, 49 insertions(+), 67 deletions(-) diff --git a/.github/.powershell-psscriptanalyzer.psd1 b/.github/.powershell-psscriptanalyzer.psd1 index 84269ea..a961da3 100644 --- a/.github/.powershell-psscriptanalyzer.psd1 +++ b/.github/.powershell-psscriptanalyzer.psd1 @@ -17,4 +17,4 @@ 'PSUseShouldProcessForStateChangingFunctions', 'PSUseDeclaredVarsMoreThanAssignments' ) -} \ No newline at end of file +} diff --git a/Sources/Winget-AutoUpdate/WAU-Policies.ps1 b/Sources/Winget-AutoUpdate/WAU-Policies.ps1 index da104c9..46c1f61 100644 --- a/Sources/Winget-AutoUpdate/WAU-Policies.ps1 +++ b/Sources/Winget-AutoUpdate/WAU-Policies.ps1 @@ -98,4 +98,4 @@ if ($WAUConfig.WAU_RunGPOManagement -eq 1) { $WAUConfig.PSObject.Properties | Where-Object { $_.Name -like "WAU_*" } | Select-Object Name, Value | Out-File -Encoding default -FilePath $GPOLogFile -Append } -Exit 0 \ No newline at end of file +Exit 0 diff --git a/Sources/Winget-AutoUpdate/functions/Add-ScopeMachine.ps1 b/Sources/Winget-AutoUpdate/functions/Add-ScopeMachine.ps1 index 42f7184..8b2785e 100644 --- a/Sources/Winget-AutoUpdate/functions/Add-ScopeMachine.ps1 +++ b/Sources/Winget-AutoUpdate/functions/Add-ScopeMachine.ps1 @@ -29,4 +29,4 @@ function Add-ScopeMachine { } $ConfigFile | ConvertTo-Json -Depth 100 | Out-File $SettingsPath -Encoding utf8 -Force -} \ No newline at end of file +} diff --git a/Sources/Winget-AutoUpdate/functions/Confirm-Installation.ps1 b/Sources/Winget-AutoUpdate/functions/Confirm-Installation.ps1 index 6d4d750..98ca81b 100644 --- a/Sources/Winget-AutoUpdate/functions/Confirm-Installation.ps1 +++ b/Sources/Winget-AutoUpdate/functions/Confirm-Installation.ps1 @@ -21,4 +21,4 @@ Function Confirm-Installation ($AppName, $AppVer) { else { return $false } -} \ No newline at end of file +} diff --git a/Sources/Winget-AutoUpdate/functions/Get-AZCopy.ps1 b/Sources/Winget-AutoUpdate/functions/Get-AZCopy.ps1 index e6f7d54..c94b175 100644 --- a/Sources/Winget-AutoUpdate/functions/Get-AZCopy.ps1 +++ b/Sources/Winget-AutoUpdate/functions/Get-AZCopy.ps1 @@ -47,4 +47,4 @@ Function Get-AZCopy ($WingetUpdatePath) { $AZCopyCurrentVersion = $AZCopyVersionRegex.Match($AZCopyCurrentVersion).Value Write-ToLog "AZCopy version $AZCopyCurrentVersion installed" } -} \ No newline at end of file +} diff --git a/Sources/Winget-AutoUpdate/functions/Get-WAUAvailableVersion.ps1 b/Sources/Winget-AutoUpdate/functions/Get-WAUAvailableVersion.ps1 index 90c90fb..24b289e 100644 --- a/Sources/Winget-AutoUpdate/functions/Get-WAUAvailableVersion.ps1 +++ b/Sources/Winget-AutoUpdate/functions/Get-WAUAvailableVersion.ps1 @@ -38,4 +38,4 @@ function Get-WAUAvailableVersion { #Return version return $WAUAvailableVersion -} \ No newline at end of file +} diff --git a/Sources/Winget-AutoUpdate/functions/Get-WAUConfig.ps1 b/Sources/Winget-AutoUpdate/functions/Get-WAUConfig.ps1 index 6f9855c..0772a82 100644 --- a/Sources/Winget-AutoUpdate/functions/Get-WAUConfig.ps1 +++ b/Sources/Winget-AutoUpdate/functions/Get-WAUConfig.ps1 @@ -23,4 +23,4 @@ Function Get-WAUConfig { #Return config return $WAUConfig -} \ No newline at end of file +} diff --git a/Sources/Winget-AutoUpdate/functions/Get-WingetCmd.ps1 b/Sources/Winget-AutoUpdate/functions/Get-WingetCmd.ps1 index a4a6781..9aa8600 100644 --- a/Sources/Winget-AutoUpdate/functions/Get-WingetCmd.ps1 +++ b/Sources/Winget-AutoUpdate/functions/Get-WingetCmd.ps1 @@ -20,4 +20,4 @@ Function Get-WingetCmd { return $WingetCmd -} \ No newline at end of file +} diff --git a/Sources/Winget-AutoUpdate/functions/Install-Prerequisites.ps1 b/Sources/Winget-AutoUpdate/functions/Install-Prerequisites.ps1 index e415828..bc37a04 100644 --- a/Sources/Winget-AutoUpdate/functions/Install-Prerequisites.ps1 +++ b/Sources/Winget-AutoUpdate/functions/Install-Prerequisites.ps1 @@ -96,4 +96,4 @@ function Install-Prerequisites { } -} \ No newline at end of file +} diff --git a/Sources/Winget-AutoUpdate/functions/Invoke-DirProtect.ps1 b/Sources/Winget-AutoUpdate/functions/Invoke-DirProtect.ps1 index 4177ab3..169f955 100644 --- a/Sources/Winget-AutoUpdate/functions/Invoke-DirProtect.ps1 +++ b/Sources/Winget-AutoUpdate/functions/Invoke-DirProtect.ps1 @@ -46,4 +46,4 @@ function Invoke-DirProtect ($ModsPath) { catch { return $false } -} \ No newline at end of file +} diff --git a/Sources/Winget-AutoUpdate/functions/Test-ListPath.ps1 b/Sources/Winget-AutoUpdate/functions/Test-ListPath.ps1 index 37de764..1edaa09 100644 --- a/Sources/Winget-AutoUpdate/functions/Test-ListPath.ps1 +++ b/Sources/Winget-AutoUpdate/functions/Test-ListPath.ps1 @@ -32,7 +32,7 @@ function Test-ListPath ($ListPath, $UseWhiteList, $WingetUpdatePath) { # Assign the second string (after "?" to the end) to the variable $sasToken $sasToken = $splitPath[1] - + # Join the parts and add "/$ListType?" in between the parts $ExternalList = -join ($resourceURI, "/$ListType`?", $sasToken) } diff --git a/Sources/Winget-AutoUpdate/functions/Test-Network.ps1 b/Sources/Winget-AutoUpdate/functions/Test-Network.ps1 index cc0e3f6..e6c6536 100644 --- a/Sources/Winget-AutoUpdate/functions/Test-Network.ps1 +++ b/Sources/Winget-AutoUpdate/functions/Test-Network.ps1 @@ -13,16 +13,18 @@ function Test-Network { $ncsiHost = Get-ItemPropertyValue -Path $NlaRegKey -Name ActiveWebProbeHost $ncsiPath = Get-ItemPropertyValue -Path $NlaRegKey -Name ActiveWebProbePath $ncsiContent = Get-ItemPropertyValue -Path $NlaRegKey -Name ActiveWebProbeContent - } catch { + } + catch { $ncsiHost = "www.msftconnecttest.com" $ncsiPath = "connecttest.txt" $ncsiContent = "Microsoft Connect Test" } - + While ($timeout -lt 1800) { try { $ncsiResponse = Invoke-WebRequest -Uri "http://$($ncsiHost)/$($ncsiPath)" -UseBasicParsing -UserAgent ([Microsoft.PowerShell.Commands.PSUserAgent]::Chrome) - } catch { + } + catch { $ncsiResponse = $false } diff --git a/Sources/Winget-AutoUpdate/functions/Update-App.ps1 b/Sources/Winget-AutoUpdate/functions/Update-App.ps1 index 9a9af04..aa72248 100644 --- a/Sources/Winget-AutoUpdate/functions/Update-App.ps1 +++ b/Sources/Winget-AutoUpdate/functions/Update-App.ps1 @@ -130,4 +130,4 @@ Function Update-App ($app) { } -} \ No newline at end of file +} diff --git a/Sources/Winget-AutoUpdate/functions/Write-ToLog.ps1 b/Sources/Winget-AutoUpdate/functions/Write-ToLog.ps1 index 1e0891e..ef495ff 100644 --- a/Sources/Winget-AutoUpdate/functions/Write-ToLog.ps1 +++ b/Sources/Winget-AutoUpdate/functions/Write-ToLog.ps1 @@ -26,7 +26,7 @@ function Write-ToLog { #If header requested if ($IsHeader) { - $Log = "#"*65 + "`n#`t$(Get-Date -Format (Get-culture).DateTimeFormat.ShortDatePattern) - $LogMsg`n" + "#"*65 + $Log = "#" * 65 + "`n#`t$(Get-Date -Format (Get-culture).DateTimeFormat.ShortDatePattern) - $LogMsg`n" + "#" * 65 } else { $Log = "$(Get-Date -UFormat "%T") - $LogMsg" diff --git a/Sources/Winget-AutoUpdate/mods/_AppID-template.ps1 b/Sources/Winget-AutoUpdate/mods/_AppID-template.ps1 index 85b09b7..5880847 100644 --- a/Sources/Winget-AutoUpdate/mods/_AppID-template.ps1 +++ b/Sources/Winget-AutoUpdate/mods/_AppID-template.ps1 @@ -93,7 +93,7 @@ if ($Proc) { Stop-ModsProc $Proc } if ($Svc) { - Stop-ModsSvc $Svc + Stop-ModsSvc $Svc } if ($Wait) { Wait-ModsProc $Wait @@ -135,4 +135,4 @@ if ($RunUser) { Invoke-ModsApp $RunUser "" "" $User } -<# EXTRAS #> \ No newline at end of file +<# EXTRAS #> diff --git a/Sources/Winget-AutoUpdate/mods/_Mods-Functions.ps1 b/Sources/Winget-AutoUpdate/mods/_Mods-Functions.ps1 index 7c098b1..01955c7 100644 --- a/Sources/Winget-AutoUpdate/mods/_Mods-Functions.ps1 +++ b/Sources/Winget-AutoUpdate/mods/_Mods-Functions.ps1 @@ -26,10 +26,10 @@ function Stop-ModsProc ($Proc) { Return } function Stop-ModsSvc ($Svc) { - foreach ($service in $Svc) { - Stop-Service -Name $service -Force -ErrorAction SilentlyContinue | Out-Null - } - Return + foreach ($service in $Svc) { + Stop-Service -Name $service -Force -ErrorAction SilentlyContinue | Out-Null + } + Return } function Wait-ModsProc ($Wait) { @@ -53,93 +53,74 @@ function Uninstall-WingetID ($WingetIDUninst) { Return } -function Uninstall-ModsApp ($AppUninst, $AllVersions) -{ - foreach ($app in $AppUninst) - { +function Uninstall-ModsApp ($AppUninst, $AllVersions) { + foreach ($app in $AppUninst) { # we start from scanning the x64 node in registry, if something was found, then we set x64=TRUE [bool]$app_was_x64 = Process-installedSoftware -app $app -x64 $true; # if nothing was found in x64 node, then we repeat that action in x86 node - if (!$app_was_x64) - { + if (!$app_was_x64) { Process-installedSoftware -app $app | Out-Null; } } Return } -Function Process-installedSoftware() -{ +Function Process-installedSoftware() { [OutputType([Bool])] Param( - [parameter(Mandatory=$true)] [string]$app, - [parameter(Mandatory=$false)][bool] $x64 = $false + [parameter(Mandatory = $true)] [string]$app, + [parameter(Mandatory = $false)][bool] $x64 = $false ) - if($true -eq $x64) - { + if ($true -eq $x64) { [string]$path = "HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall"; } - else - { + else { [string]$path = "HKLM:\Software\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall"; } [bool]$app_was_found = $false; [Microsoft.Win32.RegistryKey[]]$InstalledSoftware = Get-ChildItem $path; - foreach ($obj in $InstalledSoftware) - { - if ($obj.GetValue('DisplayName') -like $App) - { + foreach ($obj in $InstalledSoftware) { + if ($obj.GetValue('DisplayName') -like $App) { $UninstallString = $obj.GetValue('UninstallString') $CleanedUninstallString = $UninstallString.Trim([char]0x0022) - if ($UninstallString -like "MsiExec.exe*") - { + if ($UninstallString -like "MsiExec.exe*") { $ProductCode = Select-String "{.*}" -inputobject $UninstallString $ProductCode = $ProductCode.matches.groups[0].value #MSI x64 Installer $Exec = Start-Process "C:\Windows\System32\msiexec.exe" -ArgumentList "/x$ProductCode REBOOT=R /qn" -PassThru -Wait #Stop Hard Reboot (if bad MSI!) - if ($Exec.ExitCode -eq 1641) - { + if ($Exec.ExitCode -eq 1641) { Start-Process "C:\Windows\System32\shutdown.exe" -ArgumentList "/a" } } - else - { + else { $QuietUninstallString = $obj.GetValue('QuietUninstallString') - if ($QuietUninstallString) - { + if ($QuietUninstallString) { $QuietUninstallString = Select-String "(\x22.*\x22) +(.*)" -inputobject $QuietUninstallString $Command = $QuietUninstallString.matches.groups[1].value $Parameter = $QuietUninstallString.matches.groups[2].value #All EXE x64 Installers (already defined silent uninstall) Start-Process $Command -ArgumentList $Parameter -Wait } - else - { - if ((Test-Path $CleanedUninstallString)) - { + else { + if ((Test-Path $CleanedUninstallString)) { $NullSoft = Select-String -Path $CleanedUninstallString -Pattern "Nullsoft" } - if ($NullSoft) - { + if ($NullSoft) { #NSIS x64 Installer Start-Process $UninstallString -ArgumentList "/S" -Wait } - else - { - if ((Test-Path $CleanedUninstallString)) - { + else { + if ((Test-Path $CleanedUninstallString)) { $Inno = Select-String -Path $CleanedUninstallString -Pattern "Inno Setup" } - if ($Inno) - { + if ($Inno) { #Inno x64 Installer Start-Process $UninstallString -ArgumentList "/VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-" -Wait } - else - { + else { Write-Host "$(if($true -eq $x64) {'x64'} else {'x86'}) Uninstaller unknown, trying the UninstallString from registry..." $NativeUninstallString = Select-String "(\x22.*\x22) +(.*)" -inputobject $UninstallString $Command = $NativeUninstallString.matches.groups[1].value @@ -151,8 +132,7 @@ Function Process-installedSoftware() } } $app_was_found = $true - if (!$AllVersions) - { + if (!$AllVersions) { break } } diff --git a/Sources/Winget-AutoUpdate/mods/_WAU-notinstalled-template.ps1 b/Sources/Winget-AutoUpdate/mods/_WAU-notinstalled-template.ps1 index 207eec5..983ab11 100644 --- a/Sources/Winget-AutoUpdate/mods/_WAU-notinstalled-template.ps1 +++ b/Sources/Winget-AutoUpdate/mods/_WAU-notinstalled-template.ps1 @@ -16,11 +16,11 @@ This all-purpose mod will be overridden by any specific: <# MAIN #> if ($($app.Id) -eq "Microsoft.SQLServerManagementStudio") { if ($ConfirmInstall -eq $false) { - try { - Write-ToLog "...succesfully done something" "Green" + try { + Write-ToLog "...succesfully done something" "Green" } catch { - Write-ToLog "...failed to do something" "Red" + Write-ToLog "...failed to do something" "Red" } } } From 897092a7c8e0cbb5f006ee0a1460c9ef1e574c7c Mon Sep 17 00:00:00 2001 From: Romain <96626929+Romanitho@users.noreply.github.com> Date: Mon, 2 Sep 2024 16:18:38 +0200 Subject: [PATCH 3/5] Remove useless check --- Sources/Winget-AutoUpdate/functions/Start-NotifTask.ps1 | 3 --- 1 file changed, 3 deletions(-) diff --git a/Sources/Winget-AutoUpdate/functions/Start-NotifTask.ps1 b/Sources/Winget-AutoUpdate/functions/Start-NotifTask.ps1 index 326a40f..4f5ec01 100644 --- a/Sources/Winget-AutoUpdate/functions/Start-NotifTask.ps1 +++ b/Sources/Winget-AutoUpdate/functions/Start-NotifTask.ps1 @@ -137,9 +137,6 @@ function Start-NotifTask { #Save XML to File $ToastTemplateLocation = "$($WAUConfig.InstallLocation)\config\" - if (!(Test-Path $ToastTemplateLocation)) { - New-Item -ItemType Directory -Force -Path $ToastTemplateLocation - } $ToastTemplate.Save("$ToastTemplateLocation\notif.xml") #Run Notify scheduled task to notify conneted users From a173ccc052debae38ede22647aa3ff12869588fb Mon Sep 17 00:00:00 2001 From: Romain <96626929+Romanitho@users.noreply.github.com> Date: Mon, 2 Sep 2024 16:39:22 +0200 Subject: [PATCH 4/5] spell --- .github/cspell.json | 25 +++++++++++++++++-- README.md | 2 +- Sources/WAU Configurator.bat | 6 ++--- Sources/Winget-AutoUpdate/Winget-Install.ps1 | 4 +-- .../functions/Add-ScopeMachine.ps1 | 2 +- .../functions/Get-WingetOutdatedApps.ps1 | 8 +++--- .../functions/Install-Prerequisites.ps1 | 4 +-- 7 files changed, 36 insertions(+), 15 deletions(-) diff --git a/.github/cspell.json b/.github/cspell.json index e974314..5993535 100644 --- a/.github/cspell.json +++ b/.github/cspell.json @@ -13,7 +13,28 @@ "Notif", "HKLM", "MSIX", - "msixbundle" + "msixbundle", + "notinstalled", + "norestart", + "wekyb*", + "azcopy*", + "Destinationpath", + "Redistributable", + "redist", + "tasktrigger", + "Dont", + "Listpath", + "ncsi", + "msftconnecttest", + "connecttest", + "Balise", + "logfile", + "Uninst", + "inputobject", + "msiexec", + "VERYSILENT", + "SUPPRESSMSGBOXES", + "subfolders" ], "ignorePaths": [ ".github/*", @@ -25,4 +46,4 @@ "*.csv", "*.txt" ] -} +} \ No newline at end of file diff --git a/README.md b/README.md index febfc12..d61b94d 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ This project uses the Winget tool to daily update apps (with system context) and ![image](https://user-images.githubusercontent.com/96626929/150645599-9460def4-0818-4fe9-819c-dd7081ff8447.png) -## Intallation +## installation Just [download latest release (WAU-Configurator.zip)](https://github.com/Romanitho/Winget-AutoUpdate/releases/latest/download/WAU-Configurator.zip), unzip, run "WAU Configurator": ![WAU Configurator Screenshot](https://github.com/Romanitho/Winget-AutoUpdate/assets/96626929/e3c3a331-1c49-40c5-8f70-e39cf9fc7fd1) diff --git a/Sources/WAU Configurator.bat b/Sources/WAU Configurator.bat index 2532989..958b549 100644 --- a/Sources/WAU Configurator.bat +++ b/Sources/WAU Configurator.bat @@ -92,7 +92,7 @@ function Get-WingetAppInfo ($SearchApp) { #Search for winget apps $AppResult = & $Winget search $SearchApp --accept-source-agreements --source winget | Out-String - #Start Convertion of winget format to an array. Check if "-----" exists + #Start Conversion of winget format to an array. Check if "-----" exists if (!($AppResult -match "-----")) { Start-PopUp "No application found!" Start-Sleep 2 @@ -111,7 +111,7 @@ function Get-WingetAppInfo ($SearchApp) { $fl = $fl - 1 - #Get header titles [without remove seperator] + #Get header titles [without remove separator] $index = $lines[$fl] -split '(?<=\s)(?!\s)' # Line $fl has the header, we can find char where we find ID and Version [and manage non latin characters] @@ -129,7 +129,7 @@ function Get-WingetAppInfo ($SearchApp) { $nameDeclination = $($line.Substring(0, $idStart) -replace '[\u4e00-\u9fa5]', '**').Length - $line.Substring(0, $idStart).Length $software.Name = $line.Substring(0, $idStart - $nameDeclination).TrimEnd() $software.Id = $line.Substring($idStart - $nameDeclination, $versionStart - $idStart).TrimEnd() - #add formated soft to list + #add formatted soft to list $searchList += $software } } diff --git a/Sources/Winget-AutoUpdate/Winget-Install.ps1 b/Sources/Winget-AutoUpdate/Winget-Install.ps1 index ec24e6f..77030be 100644 --- a/Sources/Winget-AutoUpdate/Winget-Install.ps1 +++ b/Sources/Winget-AutoUpdate/Winget-Install.ps1 @@ -263,7 +263,7 @@ function Uninstall-App ($AppID, $AppArgs) { #Function to Add app to WAU white list function Add-WAUWhiteList ($AppID) { - #Check if WAU default intall path is defined + #Check if WAU default install path is defined if ($WAUInstallLocation) { $WhiteList = "$WAUInstallLocation\included_apps.txt" #Create included_apps.txt if it doesn't exist @@ -281,7 +281,7 @@ function Add-WAUWhiteList ($AppID) { #Function to Remove app from WAU white list function Remove-WAUWhiteList ($AppID) { - #Check if WAU default intall path exists + #Check if WAU default install path exists $WhiteList = "$WAUInstallLocation\included_apps.txt" if (Test-Path $WhiteList) { Write-ToLog "-> Remove $AppID from WAU included_apps.txt" diff --git a/Sources/Winget-AutoUpdate/functions/Add-ScopeMachine.ps1 b/Sources/Winget-AutoUpdate/functions/Add-ScopeMachine.ps1 index 8b2785e..5b65944 100644 --- a/Sources/Winget-AutoUpdate/functions/Add-ScopeMachine.ps1 +++ b/Sources/Winget-AutoUpdate/functions/Add-ScopeMachine.ps1 @@ -1,4 +1,4 @@ -#Function to configure the prefered scope option as Machine +#Function to configure the preferred scope option as Machine function Add-ScopeMachine { #Get Settings path for system or current user diff --git a/Sources/Winget-AutoUpdate/functions/Get-WingetOutdatedApps.ps1 b/Sources/Winget-AutoUpdate/functions/Get-WingetOutdatedApps.ps1 index e0f9284..f683d4c 100644 --- a/Sources/Winget-AutoUpdate/functions/Get-WingetOutdatedApps.ps1 +++ b/Sources/Winget-AutoUpdate/functions/Get-WingetOutdatedApps.ps1 @@ -11,7 +11,7 @@ function Get-WingetOutdatedApps { #Get list of available upgrades on winget format $upgradeResult = & $Winget upgrade --source winget | Out-String - #Start Convertion of winget format to an array. Check if "-----" exists (Winget Error Handling) + #Start Conversion of winget format to an array. Check if "-----" exists (Winget Error Handling) if (!($upgradeResult -match "-----")) { return "An unusual thing happened (maybe all apps are upgraded):`n$upgradeResult" } @@ -28,7 +28,7 @@ function Get-WingetOutdatedApps { #Get header line $fl = $fl - 1 - #Get header titles [without remove seperator] + #Get header titles [without remove separator] $index = $lines[$fl] -split '(?<=\s)(?!\s)' # Line $fl has the header, we can find char where we find ID and Version [and manage non latin characters] @@ -44,7 +44,7 @@ function Get-WingetOutdatedApps { #Get header line $fl = $i - 1 - #Get header titles [without remove seperator] + #Get header titles [without remove separator] $index = $lines[$fl] -split '(?<=\s)(?!\s)' # Line $fl has the header, we can find char where we find ID and Version [and manage non latin characters] @@ -61,7 +61,7 @@ function Get-WingetOutdatedApps { $software.Id = $line.Substring($idStart - $nameDeclination, $versionStart - $idStart).TrimEnd() $software.Version = $line.Substring($versionStart - $nameDeclination, $availableStart - $versionStart).TrimEnd() $software.AvailableVersion = $line.Substring($availableStart - $nameDeclination).TrimEnd() - #add formated soft to list + #add formatted soft to list $upgradeList += $software } } diff --git a/Sources/Winget-AutoUpdate/functions/Install-Prerequisites.ps1 b/Sources/Winget-AutoUpdate/functions/Install-Prerequisites.ps1 index bc37a04..3be9bc1 100644 --- a/Sources/Winget-AutoUpdate/functions/Install-Prerequisites.ps1 +++ b/Sources/Winget-AutoUpdate/functions/Install-Prerequisites.ps1 @@ -57,7 +57,7 @@ function Install-Prerequisites { Write-ToLog "-> Microsoft.VCLibs.140.00.UWPDesktop installed successfully." "Green" } catch { - Write-ToLog "-> Failed to intall Microsoft.VCLibs.140.00.UWPDesktop..." "Red" + Write-ToLog "-> Failed to install Microsoft.VCLibs.140.00.UWPDesktop..." "Red" } finally { Remove-Item -Path $VCLibsFile -Force @@ -79,7 +79,7 @@ function Install-Prerequisites { Write-ToLog "-> Microsoft.UI.Xaml.2.8 installed successfully." "Green" } catch { - Write-ToLog "-> Failed to intall Microsoft.UI.Xaml.2.8..." "Red" + Write-ToLog "-> Failed to install Microsoft.UI.Xaml.2.8..." "Red" } finally { Remove-Item -Path $UIXamlFile -Force From b14dcc094cda7cf6647b2073e43e4673d3d59f3f Mon Sep 17 00:00:00 2001 From: Romain <96626929+Romanitho@users.noreply.github.com> Date: Mon, 2 Sep 2024 16:44:53 +0200 Subject: [PATCH 5/5] spell --- Sources/Winget-AutoUpdate/mods/_WAU-notinstalled-template.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/Winget-AutoUpdate/mods/_WAU-notinstalled-template.ps1 b/Sources/Winget-AutoUpdate/mods/_WAU-notinstalled-template.ps1 index 983ab11..9f55229 100644 --- a/Sources/Winget-AutoUpdate/mods/_WAU-notinstalled-template.ps1 +++ b/Sources/Winget-AutoUpdate/mods/_WAU-notinstalled-template.ps1 @@ -17,7 +17,7 @@ This all-purpose mod will be overridden by any specific: if ($($app.Id) -eq "Microsoft.SQLServerManagementStudio") { if ($ConfirmInstall -eq $false) { try { - Write-ToLog "...succesfully done something" "Green" + Write-ToLog "...successfully done something" "Green" } catch { Write-ToLog "...failed to do something" "Red"