简体   繁体   中英

Calling Powershell Cmdlets in VBScript

Is it possible to give a call to PowerShell Cmdlets in my VBScript?

I know how can I call entire Powershell Script, but instead I want to call some specific Cmdletes only. Also is it possible to get that result of Cmdlet to be stored in some Object in VBScript.

I don't have much idea about Powershell and VBScript. May be this is very question. Please let me know if you have idea how can we do this.

You can try ActiveXPosh (COM component) from Sapien. It is a special PowerShell host that allows developers/scripters to run single cmdlets or entire scripts from VBScript/JScript code. You can find it in the Downloads section under Free Components (registration needed, free):

http://www.sapien.com/blog/2008/06/25/activexposh-is-now-a-free-download/

You could have PowerShell serialize objects to some sort of common format, like JSON or XML, and then import it in your VBscript. That's probably the best way to interoperate between VBscript and PowerShell.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM