Hi, I am new to R and struggling. The code below exports the PowerBI audit and displays it within R. How would I export that to a SQL table? I have tried and tried and just not getting anywhere. Thank you...
Login-PowerBIServiceAccount
#change the first number to the number of days you want to go back
1..1 |
foreach {
$Date = (((Get-Date).Date).AddDays(-$_))
$StartDate = (Get-Date -Date ($Date) -Format yyyy-MM-ddTHH:mm:ss)
$EndDate = (Get-Date -Date ((($Date).AddDays(1)).AddMilliseconds(-1)) -Format yyyy-MM-ddTHH:mm:ss)
$activities = Get-PowerBIActivityEvent -StartDateTime $StartDate -EndDateTime $EndDate
#Use to display output
Write-Output $activities