Skip to content

Instantly share code, notes, and snippets.

@HostileCoding
Created April 16, 2014 09:16
Show Gist options
  • Select an option

  • Save HostileCoding/10839048 to your computer and use it in GitHub Desktop.

Select an option

Save HostileCoding/10839048 to your computer and use it in GitHub Desktop.
<?php
$variable1=$_POST["sendpowercli"];
//Post Data
if ($variable1 != null){
$command = $variable1;
$powercli = "C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe -psc \"C:\\Program Files (x86)\\VMware\\Infrastructure\\vSphere PowerCLI\\vim.psc1\" -Command \"& {$command}\"";
$query = shell_exec("$powercli");
echo $query;
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment