Redian新闻
>
如何在Java上跑Windows PowerShell cmdlet?
avatar
如何在Java上跑Windows PowerShell cmdlet?# Java - 爪哇娇娃
S*h
1
We want to host a Web Service in an internet facing web server and push software updates to Windows and Linux machines from this Web Service. In the Windows environment,the Windows machine management tasks are typically done by Windows PowerShell with Windows Management Instrumentation(WMI) query.
In our initial analysis, we prefer to use Java and Apache Axis2 to implement this Web Service. The question comes to how to make Java execute PowerShell commands in the web service? If Java can’t do this, are there other alternatives that can make this web service perform OS configuration and machine management tasks for both Windows and Linux machines?
先谢过
avatar
g*g
2
I don't know much about PowerShell. But as long as you can run the
thing as a script, it should be fine. A script can be ran by calling
Runtime.exec

software updates to Windows and Linux machines from this Web Service. In
the Windows environment,the Windows machine management tasks are typically
done by Windows PowerShell wi
implement this Web Service. The question comes to how to make Java execute
PowerShell commands in the web service? If Java can’t do this, are there
other alternatives that can make

【在 S*******h 的大作中提到】
: We want to host a Web Service in an internet facing web server and push software updates to Windows and Linux machines from this Web Service. In the Windows environment,the Windows machine management tasks are typically done by Windows PowerShell with Windows Management Instrumentation(WMI) query.
: In our initial analysis, we prefer to use Java and Apache Axis2 to implement this Web Service. The question comes to how to make Java execute PowerShell commands in the web service? If Java can’t do this, are there other alternatives that can make this web service perform OS configuration and machine management tasks for both Windows and Linux machines?
: 先谢过

avatar
S*h
3
Yes, PowerShell can be run as a script.
To run PowerShell script, you need to install PowerShell 2.0 and, ideally,
use Putty Plink to SSH from Powershell.
I looked up the internet. It seems that PowerShell has a version for Apache
Linux server called PASH: http://blogs.msdn.com/b/powershell/archive/2008/04/08/powershell-on-linux-solaris-mac-etc.aspx
Does anyone ever execute PowerShell (PASH) from Java in Linux server? Does
it work fine?

execute

【在 g*****g 的大作中提到】
: I don't know much about PowerShell. But as long as you can run the
: thing as a script, it should be fine. A script can be ran by calling
: Runtime.exec
:
: software updates to Windows and Linux machines from this Web Service. In
: the Windows environment,the Windows machine management tasks are typically
: done by Windows PowerShell wi
: implement this Web Service. The question comes to how to make Java execute
: PowerShell commands in the web service? If Java can’t do this, are there
: other alternatives that can make

avatar
t*s
4
execute PowerShell on Linux server?
PowerShell need .Net Framework support, so you need have a .Net Framework
environment on Linux server first, then implement PowerShell runtime on
Linux

Apache

【在 S*******h 的大作中提到】
: Yes, PowerShell can be run as a script.
: To run PowerShell script, you need to install PowerShell 2.0 and, ideally,
: use Putty Plink to SSH from Powershell.
: I looked up the internet. It seems that PowerShell has a version for Apache
: Linux server called PASH: http://blogs.msdn.com/b/powershell/archive/2008/04/08/powershell-on-linux-solaris-mac-etc.aspx
: Does anyone ever execute PowerShell (PASH) from Java in Linux server? Does
: it work fine?
:
: execute

avatar
S*h
5
多谢指点
I searched internet and found a .NET Framework for non-MS platform called "Mono".
http://www.mono-project.com/Main_Page
Is this the .NET framework you talked about? So once I install Mono, I am able to run PowerShell script at Java Web Service via Java RunTime.exec?

【在 t*****s 的大作中提到】
: execute PowerShell on Linux server?
: PowerShell need .Net Framework support, so you need have a .Net Framework
: environment on Linux server first, then implement PowerShell runtime on
: Linux
:
: Apache

avatar
t*s
6
see my reply to your message

"Mono".
able to run PowerShell script at Java Web Service via Java RunTime.exec?

【在 S*******h 的大作中提到】
: 多谢指点
: I searched internet and found a .NET Framework for non-MS platform called "Mono".
: http://www.mono-project.com/Main_Page
: Is this the .NET framework you talked about? So once I install Mono, I am able to run PowerShell script at Java Web Service via Java RunTime.exec?

avatar
g*g
7
Don't count on Mono to run anything serious. Just write a shell
script on linux and be done with it.

"Mono".
able to run PowerShell script at Java Web Service via Java RunTime.exec?

【在 S*******h 的大作中提到】
: 多谢指点
: I searched internet and found a .NET Framework for non-MS platform called "Mono".
: http://www.mono-project.com/Main_Page
: Is this the .NET framework you talked about? So once I install Mono, I am able to run PowerShell script at Java Web Service via Java RunTime.exec?

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。