Last active
December 13, 2017 14:04
-
-
Save KirillPashkov/2599e11476afa1086efde5de277b2497 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function InvokePS(Command) | |
cmd = "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -ExecutionPolicy Bypass -Command " & Command | |
Set shell = CreateObject("WScript.Shell") | |
Set executor = shell.Exec(cmd) | |
executor.StdIn.Close | |
InvokePS = executor.StdOut.ReadAll | |
End Function | |
Output = REPLACE(InvokePS(Command),vbCrLf,"") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment