This post has been de-listed
It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.
4
Trying to learn Write-Progress cmdlet
Post Flair (click to view more posts with a particular flair)
Post Body
I'm still working on wrapping my head around how I can incorporate this cmdlet into my scripts. I wrote the following but the first line that gathers all the info takes as long as the entire rest of the function. Is it possible to improve this ie move the information gathering into the progress??
Function Get-InstalledApps(){
$Installed_Apps = Get-CimInstance -ClassName Win32_Product | Select-Object -Property Name,Version,InstallDate,InstallSource
For($i = 1; $i -le $Installed_Apps.count; $i )
{ Write-Progress -Activity "Gathering Installed Apps" -status "Found App $i" `
-percentComplete ($i / $Installed_Apps.count*100)}
$Installed_Apps | Select name,version}
Author
Account Strength
90%
Account Age
9 years
Verified Email
Yes
Verified Flair
No
Total Karma
4,174
Link Karma
215
Comment Karma
3,959
Profile updated: 3 days ago
Posts updated: 3 days ago
Subreddit
Post Details
We try to extract some basic information from the post title. This is not
always successful or accurate, please use your best judgement and compare
these values to the post title and body for confirmation.
- Posted
- 4 years ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/PowerShell/...