code: @SuppressWarnings("WeakerAccess")
      public PowerShellResponse executeScript(String scriptPath, String params) {
          BufferedReader srcReader;
  
          try {
              srcReader = new BufferedReader(new FileReader(new File(scriptPath)));
          } catch (FileNotFoundException fnfex) {
              logger.log(Level.SEVERE,
                      "Unexpected error when processing PowerShell script: file not found", fnfex);
              return new PowerShellResponse(true, "Wrong script path: " + scriptPath, false);
          }
  
          return executeScript(srcReader, params);
      }
docs: Executed the provided PowerShell script in PowerShell console and gets
  result.
  
  @param scriptPath the full path of the script
  @param params     the parameters of the script
  @return response with the output of the command