Joy
Joy

Reputation: 945

How to install the Powershell Module MicrosoftPowerBIMgmt with offline?

I want to install the Powershell Module MicrosoftPowerBIMgmt with below command line:

Install-Module -Name MicrosoftPowerBIMgmt 

However, the script is executed, but it may be limited by my network, the command line has been stuck in downloading the microsoftpowerbimgmt.profile file, and the progress is 0.

It seems that I can't use the command to complete the download. So I wonder if there is any other scheme to install this module?

Any advice is greatly appreciated.

By the way, my system is windows 10.

Upvotes: 0

Views: 2228

Answers (1)

Darin
Darin

Reputation: 2368

I decided to run the install you gave and checking the docs it shows that one of the commands is Get-PowerBIWorkspace. With that in mind, I decided to try this trick:

(Get-Command Get-PowerBIWorkspace).dll

Which gave this result:

C:\Program Files\WindowsPowerShell\Modules\MicrosoftPowerBIMgmt.Workspaces\1.2.1093\lib\netstandard2.0\Microsoft.PowerBI.Commands.Workspaces.dll

This told me to look in C:\Program Files\WindowsPowerShell\Modules\ for the module. Checking that location, I found the following folders were added:

09/17/2022  08:52 PM    <DIR>          MicrosoftPowerBIMgmt.Profile
09/17/2022  08:52 PM    <DIR>          MicrosoftPowerBIMgmt.Admin
09/17/2022  08:53 PM    <DIR>          MicrosoftPowerBIMgmt.Capacities
09/17/2022  08:53 PM    <DIR>          MicrosoftPowerBIMgmt.Data
09/17/2022  08:53 PM    <DIR>          MicrosoftPowerBIMgmt.Reports
09/17/2022  08:53 PM    <DIR>          MicrosoftPowerBIMgmt.Workspaces
09/17/2022  08:53 PM    <DIR>          MicrosoftPowerBIMgmt

Checking the folders show that the data is around 50 MB. Modules are usually entirely contained in the module folder with no external changes made to the system (such as registry changes, or other files placed elsewhere). Since this is Microsoft, that might not be the case.

If I was in your shoes, I would probably use xcopy, or use a copy method you are familiar with, to copy these folders to the module folder on the system where you want the MicrosoftPowerBIMgmt module installed.

If these folders truly contain everything that makes the modules work, and you copy them to the module folder that is normally found in $Env:PSModulePath, then you should be able to successfully run your script.

Upvotes: 1

Related Questions