VMware Cloud Community
tdubb123
Expert
Expert
Jump to solution

cannot validate argument on parameter

not sure why I am getting this error

get-vmhost (get-content "c:\scripts\esxhosts.txt")

Screen Shot 2018-08-21 at 6.36.42 AM.png

Reply
0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

Are you really sure?

empty.png


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

Reply
0 Kudos
7 Replies
LucD
Leadership
Leadership
Jump to solution

Try like this

Get-VMHost -Name (get-content "c:\scripts\esxhosts.txt")


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
tdubb123
Expert
Expert
Jump to solution

hi lucd

got same error

Screen Shot 2018-08-21 at 6.41.38 AM.png

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

And what do you have in the file C:\scripts\esxhosts.txt?
Is there anything in there?

I can only simulate the same behaviour with an empty file.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
tdubb123
Expert
Expert
Jump to solution

the txt file is not empty

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

Are you really sure?

empty.png


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
tdubb123
Expert
Expert
Jump to solution

Screen Shot 2018-08-21 at 7.12.55 AM.png

Reply
0 Kudos
tdubb123
Expert
Expert
Jump to solution

Ok I believe there was an error in my txt file when i copied a column o er from a csv file. I corrected it and works now

Thanks Lucd

Reply
0 Kudos