Skip to content

Instantly share code, notes, and snippets.

@anelliaf
anelliaf / pbi_listPowerBIWorkspaces.ps1
Last active October 1, 2020 18:15
PowerShell script to list Power BI workspaces and export to Excel
Connect-PowerBIServiceAccount
#Get-PowerBIWorkspace | Get-Member
#$ws = Get-PowerBIWorkspace -Scope Organization -Filter "tolower(name) eq 'testworkspace'"
#$ws = Get-PowerBIWorkspace -Scope Organization | Where {($_.IsOnDedicatedCapacity -eq $true) -and ($_.State -eq "Active") -and ($_.Type -ne "PersonalGroup")}
$ws = Get-PowerBIWorkspace -Scope Organization -All
$workspace =
foreach ($w in $ws) {
[PSCustomObject] @{
@anelliaf
anelliaf / az_getSQLDatabaseListInExcel.ps1
Created October 1, 2020 18:05
PowerShell script to list all Azure SQL Databases in a Azure Subscription
PARAM(
[string] [Parameter(Mandatory = $True, HelpMessage = "Choose subscription you want be inventored")] $SubscriptionName
)
#Variables
$ReportDate = (Get-Date).ToString("yyyy-MM-dd HH:mm")
#Login to Azure
Connect-AzAccount