Validate PowerShell prerequisite. Update documentation.
authorBen Monroe <bendono@gmail.com>
Thu, 25 Feb 2016 12:51:35 +0000 (21:51 +0900)
committerBen Monroe <bendono@gmail.com>
Thu, 25 Feb 2016 17:09:07 +0000 (02:09 +0900)
Commit migrated from https://github.com/dotnet/coreclr/commit/70749779abb4994ef4087f305c41ee14ca495e0b

docs/coreclr/building/windows-instructions.md
src/coreclr/build.cmd

index 28fd3ec..6ac3933 100644 (file)
@@ -32,6 +32,10 @@ any recent (2.4+) version of Python should work, including Python 3.
 - Install [Python](https://www.python.org/downloads/) for Windows.
 - Add it to the PATH environment variable.
 
+PowerShell
+----------
+PowerShell is used in the build system. Ensure that it is accessible via the PATH environment variable. Typically this is %SYSTEMROOT%\System32\WindowsPowerShell\v1.0\.
+
 Git Setup
 ---------
 
index 5ace7f7..f0c219b 100644 (file)
@@ -212,6 +212,10 @@ if defined __MscorlibOnly goto CheckVS
 
 echo %__MsgPrefix%Checking prerequisites
 
+:: Validate that PowerShell is accessibile.
+for %%X in (powershell.exe) do (set __PSDir=%%~$PATH:X)
+if not defined __PSDir goto NoPS
+
 :: Eval the output from probe-win1.ps1
 for /f "delims=" %%a in ('powershell -NoProfile -ExecutionPolicy RemoteSigned "& ""%__SourceDir%\pal\tools\probe-win.ps1"""') do %%a
 
@@ -650,6 +654,12 @@ echo     build all x64 x86 Checked Release
 echo        -- builds x64 and x86 architectures, Checked and Release build types for each
 exit /b 1
 
+:NoPS
+echo PowerShell is a prerequisite to build this repository, but it is not accessible.
+echo Ensure that it is defined in the PATH environment variable.
+echo Typically it should be %%SYSTEMROOT%%\System32\WindowsPowerShell\v1.0\.
+exit /b 1
+
 :NoVS
 echo Visual Studio 2015+ ^(Community is free^) is a prerequisite to build this repository.
 echo See: https://github.com/dotnet/coreclr/blob/master/Documentation/project-docs/developer-guide.md#prerequisites