Just wondering if anyone else has been toying with integrating PowerShell and VBScript?
Today I wrote a VBScript which executes and launches a saved PowerShell PS1 script.
Basically all that is needed is to use WSHShell to run an instance of CMD.EXE and then execute PowerShell.exe with the PS1 file as an argument.
The trick however on XP to getting this to work was to set the zone for the PS1 file. You need to set it to zero to ensure you are not prompted to continue running the script.
To set a zone on a PS1 do the following.
notepad scriptname.PS1:Zone.Identifier
Set the zone to 0 as follows.
[zonetransfer]
ZoneId=0
I next want to play with passing arguments from vbscript to PowerShell. Anybody done this yet?
I hope you find this post helpful.
Regards,
Mark
Check out my scripting solutions at
Work SMARTER not HARDER. The Spider's Parlor's Admin Script Pack is a collection of Administrative scripts designed to make IT Administration easier! Save time, get more work done, get the Admin Script Pack.
Today I wrote a VBScript which executes and launches a saved PowerShell PS1 script.
Basically all that is needed is to use WSHShell to run an instance of CMD.EXE and then execute PowerShell.exe with the PS1 file as an argument.
The trick however on XP to getting this to work was to set the zone for the PS1 file. You need to set it to zero to ensure you are not prompted to continue running the script.
To set a zone on a PS1 do the following.
notepad scriptname.PS1:Zone.Identifier
Set the zone to 0 as follows.
[zonetransfer]
ZoneId=0
I next want to play with passing arguments from vbscript to PowerShell. Anybody done this yet?
I hope you find this post helpful.
Regards,
Mark
Check out my scripting solutions at
Work SMARTER not HARDER. The Spider's Parlor's Admin Script Pack is a collection of Administrative scripts designed to make IT Administration easier! Save time, get more work done, get the Admin Script Pack.