Forum Discussion
PowerShell script example on how to run full refresh of incremental dataset?
- 5 years ago
Found out how to pull it off.
You create a .json file with this information:
{ "refresh": { "type": "full", "applyRefreshPolicy": false, "objects": [ { "database": "Your Dataset Name" } ] } }Then you create an Powershell script-file:
#Set Credentials $userName = "[email protected]" $password = ConvertTo-SecureString -String "YourPassword" -AsPlainText -Force $Credential = New-Object -TypeName "System.Management.Automation.PSCredential" -ArgumentList $userName, $password #Execute refresh $InputFileRefresh ="D:\MyJsonFile.json" invoke-ascmd -Server "powerbi://api.powerbi.com/v1.0/myorg/Your Workspace Name" -InputFile $InputFileRefresh -Credential $CredentialThat runs a full refresh of the dataset (but you won't see it running in the Power BI service and the Last Refresh Date in the PBI service will not be updated, just the data in the dataset).
Ok thank you for your answer. 😀
What module did you downloaded in order to run "Invoke-ascm" ?
I have an error message " invoke-ascmd' is not recognized as the name of a cmdlet" even with the Sqlserver and MicrosoftPowerBIMgmt.Profile modules.
Sorry i'm a beginner...
Thank you for your time.
And just to double cross everything - sometimes you refer to the command as "invoke-ascm", make sure you have "invoke-ascmd" in your powershell code?