Reply to Message

View discussion in a popup

Replying to:
jvm2016
Hot Shot
Hot Shot

import-csv

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:\Users\jvmishra\Desktop\fileroot.csv"

foreach($e in $esxis)

{

$v=$e.esxiname

$v

get-vmhost -Name $v

}

Reply
0 Kudos