1. Name the script as .ps1
2. Under Powershell, remember to set Set-ExecutionPolicy RemoteSigned or Set-ExecutionPolicy Unrestricted
3. To run the powershell script outside powershell :
powershell.exe -noexit c:\scripts\test.ps1
powershell.exe -noexit get-childitem c:\scripts
Call from vbscript
Set objShell = CreateObject(“Wscript.Shell”)
objShell.Run(“powershell.exe -noexit c:\scripts\test.ps1”)
Leave a Reply