I wrote a PowerShell script that uses the ReportingServicesTools to deploy reports to a PowerBI Report Server after a project build has terminated. When logging onto the server as myself and executing the script the module is imported successfully and the script executes.
When i execute the target script in a Azure DevOps release pipeline using a Powershell task the following error is returned:
import-module : The specified module 'ReportingServicesTools' was not loaded because no valid module file was found in any module directory. At D:\DevOps Agent\DeploySSRS2.ps1:3 char:1 import-module -Name ReportingServicesTools
We are using a Self-Hosted agent for our releases and builds and the server has PS 5 installed.
I tried:
- Moving the module into C:\Program Files\WindowsPowerShell\Modules as MSDN stated this would make the module visible to all users.
- Adding the module into C:\Windows\system32\WindowsPowerShell\v1.0\Modules
- Referencing the whole path instead of just the module name in the script.