Skip to content

Instantly share code, notes, and snippets.

@TinyToons
TinyToons / Export-ModelSize.ps1
Last active August 17, 2022 10:55 — forked from ghotz/Get-ASDBSizes.ps1
Get Analysis Services databases size
<#
.SYNOPSIS
Export Power BI Model Size
.DESCRIPTION
#>
function Export-ModelSize{
param(
@TinyToons
TinyToons / Get-PowerBI-DiagPort.ps1
Created August 17, 2022 10:10 — forked from guyinacube/Get-PowerBI-DiagPort.ps1
Get the Power BI Diagnostic port using PowerShell
#PLEASE OPEN YOUR POWER BI DESKTOP FILE BEFORE RUNNING THIS SCRIPT!!!!!
#Gets a list of teh ProcessIDs for all Open Power BI Desktop files
$processids = Get-Process msmdsrv | Select-Object -ExpandProperty id
#Loops through each ProcessIDs, gets the diagnostic port for each file, and finally generates the connection that can be use when connecting to the Vertipaq model.
if($processids)
{
foreach($processid in $processids)
{
@TinyToons
TinyToons / Text.CreateEmptyTableFromSchema.pq
Last active August 2, 2023 21:03 — forked from ImkeF/Text.CreateEmptyTableFromSchema.pq
Creates the M-code for an empty table based on a table schema (Table.Schema).
let
fnFormatted = let
func = (myTable as table) =>
let
#"Table1 Schema" = Table.Schema(myTable),
TypesList = Table.AddColumn(
#"Table1 Schema",
"TypeRecord",
each "#""" & [Name] & """=" & [TypeName]
)[TypeRecord],