Link to home
Start Free TrialLog in
Avatar of Bobby Batts
Bobby BattsFlag for United States of America

asked on

PowerCLI Script used to Collect Host Logs

I am attempting to run the following simple PowerCLI script to collect host logs.

code…

Connect-VIServer myviserver
$esx = Get-VMHost myhost
$log = Get-Log -Key “vmkernel” -VMhost $esx
$log.entries > c:\logs.txt


When I run the script an error message is generated.

It reports that the Connect-VIServer command is not recognized as the name of a cmdlet.

Any ideas why this error message in being presented.

Thanks,

Lipotech
ASKER CERTIFIED SOLUTION
Avatar of Andrew Hancock (VMware vExpert PRO / EE Fellow/British Beekeeper)
Andrew Hancock (VMware vExpert PRO / EE Fellow/British Beekeeper)
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial