Skip to content

Commit 116de5d

Browse files
committed
Test powershell v5 or higher
1 parent 0018224 commit 116de5d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

win/build-deps.cmd

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,10 @@ FOR %%i IN (powershell git cmake) DO (
8585
where.exe %%i 1> NUL 2> NUL || call cecho.cmd 0 12 "Required tool `'%%i`' not installed or not added to PATH" && goto :ErrorAndPrintUsage
8686
)
8787

88+
:: Check powershell version
89+
powershell -c "exit $PSVersionTable.PSVersion.Major -lt 5"
90+
IF NOT %ERRORLEVEL%==0 call cecho.cmd 0 12 "Powershell version 5 or higher required" && goto :ErrorAndPrintUsage
91+
8892
cmake --version | findstr version > temp.txt
8993
set /p CMAKE_VERSION=<temp.txt
9094
del temp.txt
@@ -547,7 +551,7 @@ exit /b %RET%
547551
:: PrintUsage - Prints usage information
548552
:PrintUsage
549553
call "%~dp0\utils\cecho.cmd" 0 10 "Requirements for a successful execution:"
550-
echo 1. Install PowerShell (preinstalled in Windows ^>= 7) and make sure 'powershell' is accessible from PATH.
554+
echo 1. Install PowerShell (preinstalled in Windows ^>= 7) version 5 or higher and make sure 'powershell' is accessible from PATH.
551555
echo - https://support.microsoft.com/en-us/kb/968929
552556
echo 2. Install Git and make sure 'git' is accessible from PATH.
553557
echo - https://git-for-windows.github.io/

0 commit comments

Comments
 (0)