ahaydon / Qlik-Cli-Windows

Qlik-Cli for Windows
https://adamhaydon.uk/Qlik-Cli-Windows/
GNU General Public License v2.0
109 stars 51 forks source link

Reload-Task statuses times #223

Closed itsik85 closed 1 month ago

itsik85 commented 1 month ago

Hi I have a task that is supposed to start working at 3:00:00, in fact it came into action at 3:00:45 but only to the "queue" status, then it went to "Started" status at 03:13:12. How can I get each of these times?

image

countnazgul commented 1 month ago

You can get all these times with:

Get-QlikTask -filter "id eq <TASK-ID-HERE>" -full | foreach-object {$_.operational.lastExecutionResult.details}

And check the detailCreatedDate property. These are the same details that QMC is reporting. (ignore that my times are the same. dont have an example for long running task atm)

image

itsik85 commented 1 month ago

Thank you!

I get the times in hh:mm format. Why does it also appear with the seconds? How can I add them?

image

countnazgul commented 1 month ago

hmmm. not sure. feels like it might be due to you local settings? possible to try on another machine/server?

itsik85 commented 1 month ago

I debugged the code and found the following line in the helper.ps1 file: $object.$($prop.Name) = Get-Date -Format "yyyy/MM/dd HH:mm" $object.$($prop.Name) I changed it to: $object.$($prop.Name) = Get-Date -Format "yyyy/MM/dd HH:mm:ss" $object.$($prop.Name)

Now it works fine :)

ahaydon commented 1 month ago

Rather than modifying the module code you can use the -raw flag with the Get-QlikTask command, this flag prevents the output formatting in the module from applying and just outputs the raw values from the API.