Is there any suggestion for users who call Veeam's cmdlet from Java?
We found we can't get output on console because "Install-VeeamToolkit.ps1" uses "-noexit" parameter.
However, if we want to use Java to call Veeam's cmdlet, we need to call "Install-VeeamToolkit.ps1" and also need to know powershell finishes all cmdlets.
(Process proc = runtime.exec(command);
proc.getOutputStream().close(); => can't work with "install-VeeamToolkit.ps1")
-
- Expert
- Posts: 109
- Liked: never
- Joined: Apr 02, 2013 7:55 am
- Full Name: Sum Wu
- Contact:
-
- Product Manager
- Posts: 20400
- Liked: 2298 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: Running PowerShell under Java
Why do you need to install Veeam PS snap-in each time? May be, you can install it just once, and, then, just reference it in the script, using Add-PSSnapin commadlet. Thanks.However, if we want to use Java to call Veeam's cmdlet, we need to call "Install-VeeamToolkit.ps1" and also need to know powershell finishes all cmdlets.
-
- Expert
- Posts: 109
- Liked: never
- Joined: Apr 02, 2013 7:55 am
- Full Name: Sum Wu
- Contact:
Re: Running PowerShell under Java
I tried to use " Add-PSSnapin -name "VeeamPSSnapIn" but still can't use Veeam PowerSheel cmdlet.
I also try "powershell – import system modules". It imports Veeam-PSSnapIn. But it can't work.
any hits?
I also try "powershell – import system modules". It imports Veeam-PSSnapIn. But it can't work.
any hits?
-
- Product Manager
- Posts: 20400
- Liked: 2298 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: Running PowerShell under Java
I'm not that familiar with Java and have no clues on what might be going wrong. As far as I know, if the our PS snap-in is installed on remote machine and the required script is stored nearby, it should be possible to [urlhttp://stackoverflow.com/questions/19152360/run-a-powershell-on-a-remote-machine-using-java ]use invoke expression inside Java code to make PS work remotely[/url]. Thanks.
Who is online
Users browsing this forum: No registered users and 15 guests