---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
param (
[parameter(Mandatory=$false, HelpMessage="Wait Time")]
[int]$Time
)
[int] $Current = 0
Get-WfaLogger -Info -Message $Current
$Total = $Time*3600
$CurrentPercentage = ($Current/$Total)*100
Set-WfaCommandProgress -Total $Total -Current $Current -ProgressPercentage $CurrentPercentage
$Current=$Current + 3600
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Input given by End User : 12 hrs
This code takes Time Hour value from End User and convert into seconds. In first interval Current value will be 0 and in next interval I want to increase it to 3600 as 1 hr completes and calculate the percentage accordingly for Set-WfaCommandProgress Command-ProgressPercentage parameter
I implemented above code but the problem is everytime it re executes command at 3600 seconds interval, it will take $current value as 0 in every interval. Is there any workaround to acheive this ?
