VMware Cloud Community
mark_chuman
Hot Shot
Hot Shot

Show progress?

Anyone have an idea around how to integrate write-progress or another way of showing progress into a script snippet like this?

#Export permissions from source datacenter - export time is neglible.

Get-Datacenter $SourceDatacenter | Get-VIPermission | Where-Object{$_.Entity.Name -like "Datacenter"} `

| Export-Csv -NoTypeInformation -UseCulture -Path .\perms_export_datacenter.csv

0 Kudos
3 Replies
LucD
Leadership
Leadership

There is a good example in Making Progress

But I'm not too sure which progress you want to display in this small script ?

As you can see the progress bar is expressing a percentage of the estimated total.

For what part of this script do you want to display the progress, the Get-VIPermission cmdlet ?

I'm afraid that is not possible.


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

0 Kudos
mark_chuman
Hot Shot
Hot Shot

Thanks Luc.  I'm interested in displaying any type of activity that would show the script is still working.  I've tried "write-verbose", but it displays to the console.  Trying to get something that displays in a top window and just shows it's working.

0 Kudos
LucD
Leadership
Leadership

Did you try adding the -Verbose switch on each of the cmdlets ?

Make sure to add

$verbosepreference = "Continue"

in the script (unless you already have that in your profile)


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

0 Kudos