@@ -981,7 +981,7 @@ public void TestDotnetVersionWindows()
981981 {
982982 actions . RunProcess [ "cmd.exe /C dotnet --list-sdks" ] = 0 ;
983983 actions . RunProcessOut [ "cmd.exe /C dotnet --list-sdks" ] = "2.1.3 [C:\\ Program Files\\ dotnet\\ sdks]\n 2.1.4 [C:\\ Program Files\\ dotnet\\ sdks]" ;
984- actions . RunProcess [ @"cmd.exe /C powershell -NoProfile -ExecutionPolicy unrestricted -file C:\Project\install-dotnet.ps1 -Version 2.1.3 -InstallDir C:\Project\.dotnet" ] = 0 ;
984+ actions . RunProcess [ @"cmd.exe /C pwsh -NoProfile -ExecutionPolicy unrestricted -file C:\Project\install-dotnet.ps1 -Version 2.1.3 -InstallDir C:\Project\.dotnet" ] = 0 ;
985985 actions . RunProcess [ @"cmd.exe /C del C:\Project\install-dotnet.ps1" ] = 0 ;
986986 actions . RunProcess [ @"cmd.exe /C C:\Project\.dotnet\dotnet --info" ] = 0 ;
987987 actions . RunProcess [ @"cmd.exe /C C:\Project\.dotnet\dotnet clean C:\Project\test.csproj" ] = 0 ;
@@ -1008,6 +1008,39 @@ public void TestDotnetVersionWindows()
10081008 TestAutobuilderScript ( autobuilder , 0 , 7 ) ;
10091009 }
10101010
1011+ [ Fact ]
1012+ public void TestDotnetVersionWindowsNoPwsh ( )
1013+ {
1014+ actions . RunProcess [ "cmd.exe /C dotnet --list-sdks" ] = 0 ;
1015+ actions . RunProcessOut [ "cmd.exe /C dotnet --list-sdks" ] = "2.1.3 [C:\\ Program Files\\ dotnet\\ sdks]\n 2.1.4 [C:\\ Program Files\\ dotnet\\ sdks]" ;
1016+ actions . RunProcess [ @"cmd.exe /C pwsh -NoProfile -ExecutionPolicy unrestricted -file C:\Project\install-dotnet.ps1 -Version 2.1.3 -InstallDir C:\Project\.dotnet" ] = 1 ;
1017+ actions . RunProcess [ @"cmd.exe /C powershell -NoProfile -ExecutionPolicy unrestricted -file C:\Project\install-dotnet.ps1 -Version 2.1.3 -InstallDir C:\Project\.dotnet" ] = 0 ;
1018+ actions . RunProcess [ @"cmd.exe /C del C:\Project\install-dotnet.ps1" ] = 0 ;
1019+ actions . RunProcess [ @"cmd.exe /C C:\Project\.dotnet\dotnet --info" ] = 0 ;
1020+ actions . RunProcess [ @"cmd.exe /C C:\Project\.dotnet\dotnet clean C:\Project\test.csproj" ] = 0 ;
1021+ actions . RunProcess [ @"cmd.exe /C C:\Project\.dotnet\dotnet restore C:\Project\test.csproj" ] = 0 ;
1022+ actions . RunProcess [ @"cmd.exe /C C:\odasa\tools\odasa index --auto C:\Project\.dotnet\dotnet build --no-incremental C:\Project\test.csproj" ] = 0 ;
1023+ actions . FileExists [ "csharp.log" ] = true ;
1024+ actions . FileExists [ @"C:\Project\test.csproj" ] = true ;
1025+ actions . GetEnvironmentVariable [ "CODEQL_EXTRACTOR_CSHARP_TRAP_DIR" ] = "" ;
1026+ actions . GetEnvironmentVariable [ "CODEQL_EXTRACTOR_CSHARP_SOURCE_ARCHIVE_DIR" ] = "" ;
1027+ actions . GetEnvironmentVariable [ "PATH" ] = "/bin:/usr/bin" ;
1028+ actions . EnumerateFiles [ @"C:\Project" ] = "foo.cs\n test.cs\n test.csproj" ;
1029+ actions . EnumerateDirectories [ @"C:\Project" ] = "" ;
1030+ var xml = new XmlDocument ( ) ;
1031+ xml . LoadXml ( @"<Project Sdk=""Microsoft.NET.Sdk"">
1032+ <PropertyGroup>
1033+ <OutputType>Exe</OutputType>
1034+ <TargetFramework>netcoreapp2.1</TargetFramework>
1035+ </PropertyGroup>
1036+
1037+ </Project>" ) ;
1038+ actions . LoadXml [ @"C:\Project\test.csproj" ] = xml ;
1039+
1040+ var autobuilder = CreateAutoBuilder ( true , dotnetVersion : "2.1.3" ) ;
1041+ TestAutobuilderScript ( autobuilder , 0 , 8 ) ;
1042+ }
1043+
10111044 [ Fact ]
10121045 public void TestDirsProjWindows ( )
10131046 {
0 commit comments