When I’m bored on a Friday night and none of my twitter followers are bored enough to suggest something for me to do, I do stupid crap like this:
PowerShell code (test1.ps1):
$answer = cscript.exe /nologo .\test1.vbs
"Cosine of 33 is $answer"
VBscript code (test1.vbs):
Set sc = CreateObject("ScriptControl")
sc.Language = "jscript"
result = sc.Eval("Math.cos(" & numValue & ")")
sc = 0
Cosine = result
x = Cosine(33)
Drop both files in the same folder and run the PowerShell script to spank the VBscript into submission. Yes, I know it's not passing object handles around, but rather just passing strings around but who cares. It's Friday and I'm bored out of my skull. I have no life. I hope you do.