Merge pull request #405 from Romanitho/small-fix

Fix runas if install/uninstall bat are not run as admin
pull/407/head
Romain 2023-09-23 12:29:12 +02:00 committed by GitHub
commit 7346aca3a7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -11,5 +11,5 @@ SET arguments=-UpdatesAtLogon -UpdatesInterval Weekly -InstallUserContext -Start
:: Run Powershell Script :: :: Run Powershell Script ::
:::::::::::::::::::::::::::: ::::::::::::::::::::::::::::
SET PowershellCmd=Start-Process powershell.exe -Argument '-noprofile -executionpolicy bypass -file "%~dp0Winget-AutoUpdate-Install.ps1" %arguments% SET PowershellCmd=Start-Process powershell.exe -Verb RunAs -Argument '-noprofile -executionpolicy bypass -file "%~dp0Winget-AutoUpdate-Install.ps1" %arguments%
powershell -Command "& {Get-ChildItem -Path '%~dp0' -Recurse | Unblock-File; %PowershellCmd%'}" -Verb RunAs powershell -Command "& {Get-ChildItem -Path '%~dp0' -Recurse | Unblock-File; %PowershellCmd%'}"

View File

@ -11,5 +11,5 @@ SET arguments=-Uninstall
:: Run Powershell Script :: :: Run Powershell Script ::
:::::::::::::::::::::::::::: ::::::::::::::::::::::::::::
SET PowershellCmd=Start-Process powershell.exe -Argument '-noprofile -executionpolicy bypass -file "%~dp0Winget-AutoUpdate-Install.ps1" %arguments% SET PowershellCmd=Start-Process powershell.exe -Verb RunAs -Argument '-noprofile -executionpolicy bypass -file "%~dp0Winget-AutoUpdate-Install.ps1" %arguments%
powershell -Command "& {Get-ChildItem -Path '%~dp0' -Recurse | Unblock-File; %PowershellCmd%'}" -Verb RunAs powershell -Command "& {Get-ChildItem -Path '%~dp0' -Recurse | Unblock-File; %PowershellCmd%'}"