Auto install of PowerBI

Having recently been having rebuilding my machine I finally decided to automate the process of installing the software I need.

This was a life saver as I was reinstalling a few times to try and figure out why I wasn’t getting sound on my external monitor. So I was gradually uninstalling everything until I found out that it was Hyper-v that was causing the problem.

The outcome meant I was installing PowerBI lots and had to automate it.

The answer was a few simple bits of powershell, that checks, I really should turn this into a powershell DSC definition, that will be next.

I believe this will work moving forward as they release new versions. I’ve been told the fwLink will point to the current version. Time will tell


$PBIExe = "C:\Program Files\Microsoft Power BI Desktop\bin\PBIDesktop.exe"

$install = $false

$PBIConfig = Download-Json ""


if (test-path $PBIExe) {

    $installedVersion = [version]$(gi $PBIExe).VersionInfo.FileVersion


    $currentVersion = [version]$($PBIConfig.release.x64 | where {$_.key -eq "ClientUpdateVersion"}).value

    if ($currentVersion.Major -gt $installedVersion.Major -or$currentVersion.Minor -gt $installedVersion.Minor -or $currentVersion.Build -gt $installedVersion.Build) {$install=$true}




if ($install){

    $msiPath = "$env:temp\PowerBI.msi"



    if (test-path $msiPath ){

        #Code to check if one needs to download the msi



    if ($download){Download-File '' $msiPath}


    msiexec /i $msiPath ACCEPT_EULA=1 /passive }


This uses two functions Download-File and Download-Json


function Download-Json {

param ([string] $url)

  $downloader = new-object System.Net.WebClient

  , $downloader.DownloadString($url) |ConvertFrom-Json



function Download-File {

param ([string] $url, [string] $file)

  $downloader = new-object System.Net.WebClient

  , $downloader.DownloadFile($url, $file)


Published Thursday, March 17, 2016 6:03 PM by simonsabin
Filed under: ,


Friday, March 18, 2016 12:07 PM by Power BI Auto-Installation – Curated SQL

# Power BI Auto-Installation – Curated SQL

Pingback from  Power BI Auto-Installation – Curated SQL