-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathRun_WindowsMize.cmd
More file actions
29 lines (21 loc) · 1.07 KB
/
Run_WindowsMize.cmd
File metadata and controls
29 lines (21 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
::================================================================================================================
:: WindowsMize - Install PowerShell and Run script
::================================================================================================================
@echo off
echo Installing PowerShell ...
winget.exe install --exact --id Microsoft.PowerShell --accept-source-agreements --accept-package-agreements
echo Running WindowsMize ...
set scriptFolder=%~dp0
set windowsMizeFilePath=%scriptFolder%WindowsMize.ps1
:: "Start-Process pwsh.exe" is not launched in Windows Terminal (it opens a pwsh.exe window)
WHERE wt.exe >nul 2>nul
IF %ERRORLEVEL% EQU 0 (
REM Windows Terminal is installed
set process=wt.exe
set wtArgument=pwsh.exe
) ELSE (
set process=pwsh.exe
)
set argumentList=%wtArgument% -NoExit -NoProfile -ExecutionPolicy Bypass -File ""%windowsMizeFilePath%""
powershell.exe -NoProfile -ExecutionPolicy Bypass -Command ^
"& { Start-Process -Verb 'RunAs' -FilePath '%process%' -ArgumentList '%argumentList%' }"