@@:: This prolog allows a PowerShell script to be embedded in a .CMD file. @@:: Any non-PowerShell content must be preceeded by "@@" @@setlocal @@set POWERSHELL_BAT_ARGS=%* @@if defined POWERSHELL_BAT_ARGS set POWERSHELL_BAT_ARGS=%POWERSHELL_BAT_ARGS:"=\"% @@PowerShell -NoProfile -WindowStyle Hidden -ExecutionPolicy Bypass -Command Invoke-Expression $('$args=@(^&{$args} %POWERSHELL_BAT_ARGS%);'+[String]::Join([char]10,$((Get-Content '%~f0') -notmatch '^^@@'))) & goto :EOF <# .SYNOPSIS Install and configure Winget-AutoUpdate .DESCRIPTION This script will: - Install Winget if not present - Install Winget-AutoUpdate to get apps daily updated - Install apps with Winget from a custom list file (apps.txt) or directly from popped up default list. #> <# UNBLOCK FILES #> Get-ChildItem -R | Unblock-File <# APP INFO #> # import Appx module if the powershell version is 7/core if ( $psversionTable.PSEdition -eq "core" ) { import-Module -name Appx -UseWIndowsPowershell -WarningAction:SilentlyContinue } $Script:WAUConfiguratorVersion = Get-Content ".\Winget-AutoUpdate\Version.txt" <# FUNCTIONS #> . ".\Winget-AutoUpdate\functions\Update-WinGet.ps1" . ".\Winget-AutoUpdate\functions\Get-WingetCmd.ps1" #Function to start or update popup Function Start-PopUp ($Message) { if (!$PopUpWindow) { #Create window $inputXML = @" "@ [xml]$XAML = ($inputXML -replace 'mc:Ignorable="d"', '' -replace "x:N", 'N' -replace '^