File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -465,14 +465,14 @@ if ( ($configuration | ConvertTo-Json -Depth 1 -Compress) -ne $previousCommandLi
465465 Set-ScheduledTask - TaskName " WAU\Winget-AutoUpdate-Notify" - Action $NotifyUserAction - ErrorAction SilentlyContinue
466466 Write-LogFile " Set Winget-Autoupdate tasks to run $wauWrapperEXE ." - Severity 1
467467
468- if ( $configuration.StartMenuShortcut ) {
468+ if ( $configuration.StartMenuShortcut -eq 0 ) {
469+ rm " ${env: ProgramData} \Microsoft\Windows\Start Menu\Programs\Winget-Autoupdate-aaS" - Recurse - Force;
470+ Write-LogFile " Deleted start menu shortcuts." - Severity 1
471+ } else {
469472 md " ${env: ProgramData} \Microsoft\Windows\Start Menu\Programs\Winget-Autoupdate-aaS" ;
470473 Set-Shortcut - Target $wauWrapperEXE - Shortcut " ${env: ProgramData} \Microsoft\Windows\Start Menu\Programs\Winget-Autoupdate-aaS\Run WAU.lnk" - Arguments " [ARGSSELECTOR|user-run]"
471474 Set-Shortcut - Target " $scriptlocation \Winget-Autoupdate\logs\updates.log" - Shortcut " ${env: ProgramData} \Microsoft\Windows\Start Menu\Programs\Winget-Autoupdate-aaS\Open logs.lnk"
472475 Write-LogFile " Created start menu shortcuts to run $wauWrapperEXE ." - Severity 1
473- } else {
474- rm " ${env: ProgramData} \Microsoft\Windows\Start Menu\Programs\Winget-Autoupdate-aaS" - Recurse - Force;
475- Write-LogFile " Deleted start menu shortcuts." - Severity 1
476476 }
477477
478478 if ( $configuration.DesktopShortcut ) {
You can’t perform that action at this time.
0 commit comments