forked from ge9/IddSampleDriver
-
-
Notifications
You must be signed in to change notification settings - Fork 211
/
Copy pathmodules_install.bat
20 lines (18 loc) · 966 Bytes
/
modules_install.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
@echo off
:: Use PowerShell for elevation check and execution
powershell -NoProfile -ExecutionPolicy Bypass -Command ^
"$elevated = ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] 'Administrator');" ^
"if (-not $elevated) {" ^
"$CommandLine = '-File \"' + $MyInvocation.MyCommand.Path + '\" ' + $MyInvocation.UnboundArguments;" ^
"Start-Process -FilePath PowerShell.exe -Verb Runas -ArgumentList $CommandLine;" ^
"Exit" ^
"} else {" ^
"Install-Module -Name DisplayConfig -Scope AllUsers -Force -AllowClobber;" ^
"Install-Module -Name MonitorConfig -Scope AllUsers -Force -AllowClobber;" ^
"if ($?) {" ^
"Write-Output 'Modules installed successfully.'" ^
"} else {" ^
"Write-Output 'An error occurred while installing the modules.'" ^
"}" ^
"}"
pause