32 or 64 bit version of product: 64 bitt
Operating system: Windows Server 2016
32 or 64 bit OS: 64 bit
Good Afternoon.
Hopefully someone more knowledgable than me can help.
I am trying to write a gui which connects to our vCenter server(s) and executes a number of powerCLI commands when corresponding button is pressed.
All my codes is working fine BUT i cannot get this Progressbaroverlay to work. Some of my PowerCLI commands take several seconds to complete, I want a progress bar (or animated icon) to visualise that the command is executing.
I cannot get my head around how it works.
For Example :
This is my code :
Code: Select all
$buttonEveryVMDiskCapacity_Click={
#TODO: Place custom script here
$EveryVMdisk = ForEach ($VM in Get-VM) { ($VM.Extensiondata.Guest.Disk | Select @{ N = "Name"; E = { $VM.Name } }, DiskPath, @{ N = "Capacity(MB)"; E = { [math]::Round($_.Capacity/ 1MB) } }, @{ N = "Free Space(MB)"; E = { [math]::Round($_.FreeSpace / 1MB) } }, @{ N = "Free Space %"; E = { [math]::Round(((100 * ($_.FreeSpace))/ ($_.Capacity)), 0) } }) }
Update-DataGridView -DataGridView $datagridview1 -Item $EveryVMdisk -AutoSizeColumns AllCells
}
Code: Select all
$progressbaroverlay1_Click={
#TODO: Place custom script here
}
Thank you in advance.
Richard