This is an old revision of the document!
Converted to PowerCLI that looks like:
Get-VMHost | Set-VMHostAdvancedConfiguration -Name LVM.EnableResignature -Value 1 Get-VMHost | Get-VMHostStorage -RescanAllHBA -RescanAllVMFS Get-VMHost | Set-VMHostAdvancedConfiguration -Name LVM.EnableResignature -Value 0
https://github.com/voletri/PowerCLI-1/blob/master/Attach-SCSILun.ps1
Get-VMhost | Select -first 1
PS /inventory/scripts> cat ./get_vm_list.ps1 #!/usr/bin/pwsh $VMvCenterName = 'vcenterprod.test.lu' $VMvCenterUser = 'user_RO' $VMvCenterPass = 'ThisIsavceneter01' ### ### Connect to vCenter ### Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -WarningAction SilentlyContinue -ParticipateInCeip $false -DisplayDeprecationWarnings $false -confirm:$false $VCSession = Connect-VIServer -Server $VMvCenterName -User $VMvCenterUser -Password $VMvCenterPass Get-VM | Select Name,PowerState,@{Name=’Cluster’;Expression={$_.VMHost.Parent}},NumCpu,MemoryGB,CreateDate,@{N="Configured_OS";E={$_.ExtensionData.Config.GuestFullname}},@{N="Running_OS";E={$_.Guest.OsFullName}},@{N = "IPAdress"; E = {$_.Guest.IpAddress}} | export-csv /inventory/list_vm.csv Write-Host "##### Collect Vcenter Finished" ### ### Disconnect from vCenter ### Disconnect-VIServer -Server $VMvCenterName -Confirm:$false exit $RC