code: public PowerShellResponse executeScript(BufferedReader srcReader, String params) {
          PowerShellResponse response;
          if (srcReader != null) {
              File tmpFile = createWriteTempFile(srcReader);
              if (tmpFile != null) {
                  this.scriptMode = true;
                  response = executeCommand(tmpFile.getAbsolutePath() + " " + params);
                  tmpFile.delete();
              } else {
                  response = new PowerShellResponse(true, "Cannot create temp script file!", false);
              }
          } else {
              logger.log(Level.SEVERE, "Script buffered reader is null!");
              response = new PowerShellResponse(true, "Script buffered reader is null!", false);
          }
  
          return response;
      }
docs: Execute the provided PowerShell script in PowerShell console and gets
  result.
  
  @param srcReader the script as BufferedReader (when loading File from jar)
  @param params    the parameters of the script
  @return response with the output of the command