profesorfalken / jPowerShell

Simple Java API to interact with PowerShell console
Apache License 2.0
215 stars 83 forks source link

Internal mode set by executeScript / closing ressources by executeScript #61

Closed JUGI4U closed 5 years ago

JUGI4U commented 5 years ago

Hi,

first of all, thanks for this library! It greatly facilitates access to PowerShell.

There seems to be an issue when executeCommand is called after executeScript during the same session. In executeScript an internal flag 'scriptMode' is set to true but never reset to false on method exit. So following plain calls to executeCommand use PowerShellCommandProcessor as if it runs in scriptMode. These calls usually fail.

Another point is, that in executeScript(String scriptPath, String params), a BufferedReader is opened but seems to be never closed.

Could you please check both issues. Thanks

Juergen

profesorfalken commented 5 years ago

Hello Juergen,

Thanks for reporting it. I will check & fix it when possible.

Best regards

profesorfalken commented 5 years ago

Both bugs are fixed in the new version: https://github.com/profesorfalken/jPowerShell/releases/tag/v3.1.1

So I close this issue.

Thank you!