Difference between revisions of "Script Extracts and Examples (PowerCLI)"

Jump to navigation Jump to search
→‎Getting Started: Added "Scheduling"
(→‎ESX Log Tail: Fixed typo)
(→‎Getting Started: Added "Scheduling")
Line 95: Line 95:
To determine the version of PowerCLI currently installed use;
To determine the version of PowerCLI currently installed use;
* <code> Get-PowerCLIversion </code>
* <code> Get-PowerCLIversion </code>
=== Scheduling ===
To schedule a script to run you need to include the PowerCLI VIM console file so that PowerCLI Cmd-lets are available to your script.  The command should use the following structure...
* <code> Powershell.exe -PSConsoleFile <vim.psc1> &<script.ps1> </code>
For example, on a WinXP or Win2k3 (32bit) machine you might have something like...
* <code> C:\WINDOWS\system32\windowspowershell\v1.0\powershell.exe -PSConsoleFile "C:\Program Files\VMware\Infrastructure\vSphere PowerCLI\vim.psc1" "& C:\Scripts\ESX-probe.ps1" </code>
Or on a Win7 or Win2k8 (64bit) machine you might have something like...
* <code> Powershell -PSConsoleFile "C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI\vim.psc1" "& C:\Scripts\ESX-probe.ps1" </code>


== Useful CmdLets etc ==
== Useful CmdLets etc ==

Navigation menu