Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 219257

Re: Script not performing Task for all objects using the Get-Content cmdlet

$
0
0

I just tested this script again, and for me it is working as designed.

I strongly suspect it might be related to the hosts.txt file you are using.

 

In my test file I have 2 lines, with on each line the FQDN os an ESXi node.

 

Can you check if the following returns a VMHost object for each line your .txt file ?

 

 

$varHost=Get-Content"S:\Get-Logs\hosts.txt"

foreach ($ESXin$varHost) {

    Get-VMHost-Name$ESX

}

 


Viewing all articles
Browse latest Browse all 219257

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>