find_or_fallback "cmake cpack" "$CMAKE_BIN"
find_or_fallback "msbuild" "$MSBUILD_BIN"
-if (-NOT (cpack.exe --help | grep 'CPACK_GENERATOR')) {
+if (-NOT (cpack.exe --help | Select-String 'CPACK_GENERATOR')) {
echo "Moving $CMAKE_BIN to front of PATH in order to find CMake's cpack"
$CMAKE_BIN_ESCAPED = echo $CMAKE_BIN | sed 's#\\#\\\\#g'
$path = (Invoke-Expression 'echo $Env:Path' | sed "s#;$CMAKE_BIN_ESCAPED##")
}
$ErrorActionPreference = "Continue"
-if (-NOT (sort.exe /? 2>$null | grep "SORT")) {
+if (-NOT (sort.exe /? 2>$null | Select-String "SORT")) {
$ErrorActionPreference = "Stop"
echo "Moving C:\WINDOWS\system32 to front of PATH in order to find Windows' sort"
$path = (Invoke-Expression 'echo $Env:Path' | sed 's#;C:\\WINDOWS\\system32;#;#')
# Special checks
-if (-NOT (cpack.exe --help | grep 'CPACK_GENERATOR')) {
+if (-NOT (cpack.exe --help | Select-String 'CPACK_GENERATOR')) {
$exe = (Get-Command cpack.exe 2>$null).Source
Write-Error -EA Continue "Found an unknown cpack at $exe"
$exit_status = 1
}
$ErrorActionPreference = "Continue"
-if (-NOT (sort.exe /? 2>$null | grep "SORT")) {
+if (-NOT (sort.exe /? 2>$null | Select-String "SORT")) {
$ErrorActionPreference = "Stop"
$exe = (Get-Command sort.exe 2>$null).Source
Write-Error -EA Continue "Found an unknown sort at $exe"