Automating the world one-liner at a time…
There are a number of scenarios where you might want to call PowerShell from VBScript.
These are some of the scenarios we thought about when we considered providing a COM interface to the PowerShell engine. To ship is to choose and this scenario got a lower priority than other features so we never got around to it. Luckily, the superstars at Sapien have come to the rescue with ActiveXPosh . ActiveXPosh is a COM component which gives you easy access to PowerShell from any COM capable scripting language (VBScript, JScript and others). This has been out for a while but it came out during a period when my hair was on fire so I don't recall seeing it. There is a good description of its capabilities HERE.With ActiveXPosh you can do things like:
Set ActiveXPosh = CreateObject("SAPIEN.ActiveXPosh")if ActiveXPosh.Eval("Get-Process Winword") = vbTrue Then WScript.Echo "Word is running"Else WScript.Echo "Word is NOT running"End If
Pretty simple stuff! So - how could it get any better? Yup - you guessed it, ActiveXPosh is FREE. Is this a wonderful world or what?
Thank you SAPIEN!
Jeffrey Snover [MSFT]Windows Management Partner ArchitectVisit the Windows PowerShell Team blog at: http://blogs.msdn.com/PowerShellVisit the Windows PowerShell ScriptCenter at: http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx
I tried to install it on Windows Vista 64 bit, the installation passed successfully, without any error message, but it doesn't work. none of the sample works.... anyone know why?
I don't have access to a 64-bit system. I understand that PowerShell is installed basically twice on 64-bit systems. You may need to invoke the 32-bit version one to use this add-on.
We have a support forum for our free tools at http://support.sapien.com
If you have any trouble with this, please post there.
SAPIEN Technologies, Inc.
Another reason for not using Powerpoint is that is has no proper debugger, with vbscript I can use visual studio to write and debug scripts interactively in a nice gui environment, some of which can run to thousands of lines. I would not like to write anything more than 20 or thirty lines in powershell as I would be hard to maintain.
Powershell seems to be in a world of it's own and does not seem to fit into the rest of microsofts development environment, it's as if it were written by a seperate company.