PowerShell Script:
If ( (fltmc).Count -eq 3 ) {
$A = "CreateObject(`"Shell.Application`").ShellExecute"
$VBS = "$A `"powershell.exe`", `"-ExecutionPolicy Bypass -file $PSCommandPath`", `"`", `"RunAs`", 1"
$VBS > "$Env:tempga.vbs"
& "$Env:tempga.vbs"; exit 0
}
pause
From the script above, I create the VBScript commands to $Env:tempga.vbs, then call it.
How do I recode the following VBScript in PS1 file without making Temporary file?
then Run VBScript directly on the PS1 file.
As additional, this is content of VBS in Temp:
CreateObject("Shell.Application").ShellExecute "powershell.exe", "-ExecutionPolicy Bypass -file C:UsersHillDesktopxxx.ps1", "", "RunAs", 1