Hi,
Via Powershell I'm able to invoke the Power BI API to start a dataset refresh using the "refresh dataset in group" API but using a while loop like below on the status value doesn't appear to exit the loop when the refresh completes to a status "Completed"? How can I write logic to wait for the dataset refresh to complete as once completed I need to set a variable value to output for another process to trigger:
Solved! Go to Solution.
You forgot to set the value of $status inside the loop.
Don't ask for it every five seconds. Every minute is enough.
You forgot to set the value of $status inside the loop.
Don't ask for it every five seconds. Every minute is enough.
You were correct in the end, thanks!
I needed to get the status from the $history.status within the while loop, I was getting this from the status variable outside of the while loop so this was never changing. After setting the while loop condition status to the while loop status the correct status value was returning to exit the while loop...phew!
Thanks for your reply.
The value of status will be set by the Power BI Service, I'm using the Start-Sleep to wait for status to change to "Completed" when the refresh completes. However, once I see the refresh has completed the new status isn't reflected to exit the loop.
Thanks.
Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.
Put your data visualization and design skills to the test! This exciting challenge is happening now through May 31st!