Quantcast
Channel: VMware Communities : All Content - All Communities
Viewing all articles
Browse latest Browse all 175326

Changes needed to work in PowerCli 6.0

$
0
0

This little script use to work in 5.5, it adds information to the annotations fields per virtual machine.

I pull the information from a CSV file

What changes need to be done to get to work in powercli 6.0

 

Thank You

 

# Import the CSV file to a variable

$vms = Import-CSV C:\Scripts\RFS.csv

 

# Iterate through the virtual macines and update the custom attributes

foreach ($vm in $vms){

           Get-VM -Name $vm.name | Set-CustomField  -Name Creator -value $vm.creator |

           Set-CustomField  -Name Owner -value $vm.owner |

           Set-CustomField  -Name Purpose -value $vm.purpose |

           Set-CustomField  -Name RFS -value $vm.rfs |

           Set-CustomField  -Name TargetENDdate -value $vm.enddate

 

          

}


Viewing all articles
Browse latest Browse all 175326

Trending Articles



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