import-csv

This post was originally published on this site

Hi Luc,

 

i am getting very weird error .following code works fine till orange

however when i m trying to get vmhost to do further activities it throws error .

 

esxi1.localhost.com

get-vmhost : 28/10/2020 14:45:32 Get-VMHost VMHost with name

‘esxi1.localhost.com ‘ was not found using the specified filter(s).

At line:6 char:1

+ get-vmhost -Name $v

+ ~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : ObjectNotFound: (:) [Get-VMHost], VimException

    + FullyQualifiedErrorId : Core_OutputHelper_WriteNotFoundError,VMware.VimA

   utomation.ViCore.Cmdlets.Commands.GetVMHost

 

 

 

$esxis=import-csv “C:UsersjvmishraDesktopfileroot.csv”

foreach($e in $esxis)

{

$v=$e.esxiname

$v

get-vmhost -Name $v

}

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.