Use bash on Windows since Kokoro offers it.

Change-Id: Ied4073f8de5d2056da16b040612f239d2f05c9ce
Reviewed-on: https://code-review.googlesource.com/c/37952
Reviewed-by: Paul Wankadia <junyer@google.com>
diff --git a/kokoro/macos-cmake.sh b/kokoro/macos-cmake.sh
index dbe94cb..a87931f 100755
--- a/kokoro/macos-cmake.sh
+++ b/kokoro/macos-cmake.sh
@@ -5,10 +5,10 @@
 
 cmake -D CMAKE_BUILD_TYPE=Debug .
 cmake --build . --config Debug --clean-first
-ctest -C Debug --output-on-failure -E dfa\|exhaustive\|random
+ctest -C Debug --output-on-failure -E 'dfa|exhaustive|random'
 
 cmake -D CMAKE_BUILD_TYPE=Release .
 cmake --build . --config Release --clean-first
-ctest -C Release --output-on-failure -E dfa\|exhaustive\|random
+ctest -C Release --output-on-failure -E 'dfa|exhaustive|random'
 
 exit 0
diff --git a/kokoro/windows-cmake.bat b/kokoro/windows-cmake.bat
index e926d88..90363bc 100755
--- a/kokoro/windows-cmake.bat
+++ b/kokoro/windows-cmake.bat
@@ -1,18 +1,2 @@
-CD git/re2 ^
-  || EXIT /B 1
-
-cmake -D CMAKE_BUILD_TYPE=Debug -G "Visual Studio 14 2015" -A x64 . ^
-  || EXIT /B 1
-cmake --build . --config Debug --clean-first ^
-  || EXIT /B 1
-ctest -C Debug --output-on-failure -E dfa^|exhaustive^|random ^
-  || EXIT /B 1
-
-cmake -D CMAKE_BUILD_TYPE=Release -G "Visual Studio 14 2015" -A x64 . ^
-  || EXIT /B 1
-cmake --build . --config Release --clean-first ^
-  || EXIT /B 1
-ctest -C Release --output-on-failure -E dfa^|exhaustive^|random ^
-  || EXIT /B 1
-
-EXIT /B 0
+bash git/re2/kokoro/windows-cmake.sh
+EXIT /B %ERRORLEVEL%
diff --git a/kokoro/windows-cmake.sh b/kokoro/windows-cmake.sh
new file mode 100755
index 0000000..f43b2b3
--- /dev/null
+++ b/kokoro/windows-cmake.sh
@@ -0,0 +1,14 @@
+#!/bin/bash
+set -eux
+
+cd git/re2
+
+cmake -D CMAKE_BUILD_TYPE=Debug -G 'Visual Studio 14 2015' -A x64 .
+cmake --build . --config Debug --clean-first
+ctest -C Debug --output-on-failure -E 'dfa|exhaustive|random'
+
+cmake -D CMAKE_BUILD_TYPE=Release -G 'Visual Studio 14 2015' -A x64 .
+cmake --build . --config Release --clean-first
+ctest -C Release --output-on-failure -E 'dfa|exhaustive|random'
+
+exit 0