Earlier today, I used for the first time the Power BI REST API to access some reports in my company's workspace. This API can be used with Windows PowerShell, a tool I use on occasion but rarely for any real scripting. But after spending a couple hours familiarizing myself with both PowerShell and the API, I think I've finally got the hang of it.
If you've never used the Power BI REST API previously with PowerShell previously, you first need to download the module onto your system. Enter the following into the PowerShell console:
Install the Power BI REST API Module
Next, I will demonstrate how to quickly interact with the API and your published content. If you haven't yet, open up PowerShell ISE, an IDE for PowerShell Scripting. I encourage you to run each line of code independently (not all at once) and to examine the structure and contents of each variable. And of course, don't forget to save your script when finished.
Accessing Report Metadata
I'll be posting more tutorials and code snippets on Power BI API implementations in the future. Until then, I would strongly recommend watching Guy in a Cube tutorials on YouTube. They have some great content for all things Power BI, including implementation of the REST API. Thanks for stopping by, and happy coding!