Azure-Samples / powerbi-powershell

Samples for calling the Power BI REST API via PowerShell
MIT License
256 stars 189 forks source link

This script fails consistently when i run it under a SQL Job #11

Open dmayi opened 6 years ago

dmayi commented 6 years ago

I am able to run this script successfully on Powershell console. But my use case is to run this from a SQL job for a scheduled refresh of my PowerBI report. That is not working for me. Any hints please? Thanks

richardlhughes commented 4 years ago

Try running in CmdExec

@command=N'powershell.exe -ExecutionPolicy Bypass -Command "Import-Module ...

Maybe this will help. https://www.sqlhammer.com/running-powershell-in-a-sql-agent-job/