I have a PowerShell command which removes virtual Folder from the IIS (8.5)
Remove-Item IIS:\Sites\WebsiteName\VirtualFolderName -Force -Recurse
This works just fine when executed standalone from PowerShell console, but I want to run this from inside of a VBScript. I have VBScript something like this:
Set objShell = CreateObject("WScript.Shell")
objShell.Run("powershell.exe -noexit -Command='Remove-Item IIS:\Sites\WebsiteName\VirtualFolderName -Force -Recurse'")
When I execute above it wont work, and it just spits out the command on the PowerShell console.
Any suggestions here?