title: Why doesn't powershell script from net-core 3.1 work in Windows 7?
body: <p>I have a net-core 3.1 project which runs powershell scripts. It works fine on win10, but not on win7. I get the errorr message "Cannot find drive. A drive with the name 'c' doesn't exist". If I run the same powershell command directly in powershell, it works fine on win7 also, it is just from the c# code it doesn't work. I have referenced both Microsoft.PowerShell.SDK and System.Management.Automation version 7.0.0-rc.1. This simple console app shows the problem. Works on win10, but not on win7. Any suggestions?</p>
  
  <pre><code>static void Main(string[] args)
      {
          using (var runspace = RunspaceFactory.CreateRunspace())
          {
              runspace.Open();
              using (var ps = PowerShell.Create())
              {
                  ps.Runspace = runspace;
                  ps.AddScript("Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope CurrentUser");
                  ps.AddScript(@"$PSVersionTable.PSVersion | write-output; get-childitem -path c:\temp");
  
                  var commandResults = ps.Invoke();
  
                  Console.WriteLine($"PS command result {commandResults.Count} lines");
                  foreach (var commandResult in commandResults)
                  {
                      Console.WriteLine(commandResult);
                  }
                  if (ps.Streams.Error.Count != 0)
                  {
                      Console.WriteLine("Errors:");
                      foreach (var error in ps.Streams.Error)
                      {
                          Console.WriteLine(error.ToString());
                      }
                  }
  
                  Console.WriteLine("Finished");
                  Console.ReadLine();
              }
          }
      }
  </code></pre>