Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Create PowerBI Dataset to hold MV Person Naming and Org Data
Import-Module PowerBIPS -RequiredVersion 1.2.0.9
# PowerBI App
$clientID = "4036df76-4de6-43cb-afe6-1234567890"
$creds = Get-Credential
$authtoken = Get-PBIAuthToken -ClientId $clientID -Credential $creds
$dataSetSchema = @{
name = "EmployeePolyArchyData"
defaultMode = "PushStreaming"
; tables = @(
@{name = "EmployeeOrgInfoFull"
; columns = @(
, @{ name = "accountName"; dataType = "string" }
, @{ name = "displayName"; dataType = "string" }
, @{ name = "birthDate"; dataType = "dateTime" }
, @{ name = "city"; dataType = "string" }
, @{ name = "company"; dataType = "string" }
, @{ name = "department"; dataType = "string" }
, @{ name = "division"; dataType = "string" }
, @{ name = "employeeType"; dataType = "string" }
, @{ name = "employeeActive"; dataType = "Boolean" }
, @{ name = "exchangeMailbox"; dataType = "Boolean" }
, @{ name = "lyncEnabled"; dataType = "Boolean" }
, @{ name = "managerID"; dataType = "string" }
, @{ name = "managerName"; dataType = "string" }
, @{ name = "officeLocation"; dataType = "string" }
, @{ name = "postalCode"; dataType = "string" }
, @{ name = "state"; dataType = "string" }
, @{ name = "street"; dataType = "string" }
, @{ name = "timezone"; dataType = "string" }
, @{ name = "title"; dataType = "string" }
, @{ name = "employeeStartDate"; dataType = "dateTime" }
, @{ name = "employeeEndDate"; dataType = "dateTime" }
)}
)}
$dataSetMetadata = New-PBIDataSet -authToken $authToken -dataSet $dataSetSchema -defaultRetentionPolicy BasicFIFO -Verbose
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment