Skip to content

Instantly share code, notes, and snippets.

@mthierba
mthierba / deploy-uat.yml
Last active May 30, 2022 07:43
Introducing pbi-tools Dataset Deployments
name: Deploy-UAT
# Controls when the workflow will run
on:
push:
branches:
- 'Release/*'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
@mthierba
mthierba / .pbixproj.json
Last active May 30, 2022 06:42
Introducing pbi-tools Dataset Deployments
{
"version": "0.12",
"created": "2022-05-25T15:24:03.2613259+01:00",
"deployments": {
"Contoso": {
"mode": "Dataset",
"source": {
"type": "Folder",
"path": "./Contoso Sales"
},
GET https://api.powerbi.com/v1.0/myorg/groups
Authorization: Bearer {{$aadV2Token scopes:https://analysis.windows.net/powerbi/api/.default clientId:7f67af8a-fedc-4b08-8b4e-37c4d127b6cf}}
@mthierba
mthierba / TOM-Extract-CompatibilityRequirementsAttributes.linq
Created June 3, 2020 20:44
Post: List new features in TOM Library
<Query Kind="Statements">
<NuGetReference>Microsoft.AnalysisServices.retail.amd64</NuGetReference>
<Namespace>TOM = Microsoft.AnalysisServices.Tabular</Namespace>
</Query>
var asm = typeof(TOM.Server).Assembly;
var compatAttr = asm.GetType("Microsoft.AnalysisServices.Tabular.CompatibilityRequirementAttribute");
string ReadProperty(string name, object attr) => compatAttr.GetProperty(name).GetValue(attr).ToString();
string GetMemberType(Type t) => t.IsEnum ? "Enum" : t.IsInterface ? "Interface" : "Class";
@mthierba
mthierba / 1 - Initial Version.linq
Last active June 2, 2020 18:14
XMLA Endpoint: Create Power BI Premium Dataset via TOM
<Query Kind="Statements">
<NuGetReference>Microsoft.AnalysisServices.retail.amd64</NuGetReference>
<Namespace>AMO = Microsoft.AnalysisServices</Namespace>
<Namespace>TOM = Microsoft.AnalysisServices.Tabular</Namespace>
</Query>
var dbName = "AdventureWorksDW2014";
var model = new TOM.Model {
DefaultPowerBIDataSourceVersion = TOM.PowerBIDataSourceVersion.PowerBI_V3,
@mthierba
mthierba / .0 Instructions.md
Last active May 23, 2018 09:42
Paket/FAKE Getting Started
  1. git init
  2. Paket-Init (cinst -y Paket.PowerShell)
  3. Copy paket.bootstrapper.exe (from https://github.com/fsprojects/Paket/releases/latest) to ./.paket/paket.exe
  4. Create paket.dependencies
  5. Create build.cmd, build.fsx
  6. Create .gitignore
  7. Run Paket-Install
  8. Run ./build.cmd
@mthierba
mthierba / TOM SerializeOptions.linq
Last active February 28, 2018 09:07
TOM Scripts
<Query Kind="Statements">
<NuGetReference>Microsoft.AnalysisServices.retail.amd64</NuGetReference>
<Namespace>TOM = Microsoft.AnalysisServices.Tabular</Namespace>
</Query>
var table = new TOM.Table();
table.Measures.Add(new TOM.Measure
{
Name = "Measure1",
Expression = @"
@mthierba
mthierba / Install-NBi.ps1
Last active May 21, 2018 11:42
NBi Scripts
$release = Invoke-RestMethod -Uri "https://api.github.com/repos/Seddryck/NBi/releases/latest"
Write-Output "Latest release found: $($release.name)"
$url = $release.assets[0].browser_download_url
# Possible improvements:
# params for outdir/tempdir/release
# use GetTempPath() to download .zip file to (or use current folder)
pushd $PSScriptRoot
@mthierba
mthierba / CreateTrustedSecurityTokenIssuer.ps1
Last active August 29, 2015 14:27 — forked from andrewconnell/CreateTrustedSecurityTokenIssuer.ps1
SharePoint Hosted Apps S2S - Create Trusted Security Token Issuer
Add-PSSnapin "Microsoft.SharePoint.PowerShell"
$issuerID = "11111111-1111-1111-1111-111111111111"
$targetSiteUrl = "http://wingtipserver"
$targetSite = Get-SPSite $targetSiteUrl
$realm = Get-SPAuthenticationRealm -ServiceContext $targetSite
$registeredIssuerName = $issuerID + '@' + $realm
@mthierba
mthierba / CreateTestCertificateForS2STrust.ps1
Last active August 29, 2015 14:27 — forked from andrewconnell/CreateTestCertificateForS2STrust.ps1
SharePoint Hosted Apps S2S - Create Self-Signed Certificate for SharePoint App Server
$makecert = "C:\Program Files\Microsoft Office Servers\15.0\Tools\makecert.exe"
$certmgr = "C:\Program Files\Microsoft Office Servers\15.0\Tools\certmgr.exe"
# specify domain name for SSL certificate
$domain = "appserver.wingtip.com"
# create output directory to create SSL certificate file
$outputDirectory = "c:\Certs\"
New-Item $outputDirectory -ItemType Directory -Force -Confirm:$false | Out-Null