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 ; }
Execute the provided PowerShell script in PowerShell console and gets result .