Posts Tagged command line

Running PowerCLI scripts from Windows command line

    You can run PowerCLI scripts directly in the Windows command line. This is useful if you need to run a PowerCLI script in Windows Scheduler.

    PowerCLI must be installed on the Windows system.

    Just use the following systax:

    C:\WINDOWS\system32\windowspowershell\v1.0\powershell.exe -psconsolefile "C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI\vim.psc1" -outputformat Text -command ". \"C:\My Scripts\PowerCLI Script.ps1\" -arg1 X -arg2 Y"


No Comments