Fix runas if bat not run as admin

pull/405/head
Romain 2023-09-21 18:12:11 +02:00 committed by GitHub
parent 4357c8e245
commit dd09d341d4
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%'}"