Skip to main content

Posts

Showing posts with the label VBScript

Calling PS1 from VBS and Web-Administration without the PowerShell Module - Part1

Calling PS1 from VBS Recently I got this strange request to call PowerShell Script from VBScript... Yeah!! I am serious. Well the scenario is that we have a main VBScript which calls other VBScripts to perform Application Deployments on  Servers. In this main VBScript we want to add the functionality to start/stop websites and webapppools as these need to be stopped while deploying the web apps on the server. So to add this functionality to our VBS we want to use PowerShell Scripts. Learning ( skip these for now will make more sense after reading the post) :   WebAdministration Module doesn't work on a PowerShell Instance spawned by the VB Script. Can't really use Advanced Cmdlet Binding Attributes (next post) This task seemed to be easy enough at first ... Sample VBScript 1 : Set  objShell =  CreateObject ( "WScript.Shell" ) strCommand =  "powershell.exe -noprofile -file C:\temp\tes2t.ps1 -websitename DexTestWebsite  -action stop " s...