I have a VBscript file. I run this VBscript using CScript on windows 2012 server. The VBscript runs fine on the server.
But I need to call this VBScript file from Powershell. This is what I did.
For simplicity, this is what I have in my VBscript file
echo.vbs
Msgbox("hello world")
I wrote the test.ps1
$acommand = "C:\Windows\System32\Cscript.exe C:\deleteit\echo.vbs"
Invoke-Expression $acommand