Press "Enter" to skip to content

Category: Powershell

Getting Help in MicrosoftFabricMgmt

Rob Sewell continues a series on the Microsoft Fabric management Powershell module:

Most of this blog post is going to be more about PowerShell in general than this specific module. The MicrosoftFabricMgmt module has over 295 cmdlets, which can be overwhelming at first glance. But PowerShell’s built-in discovery tools make it easy to find what you need. Knowing how to use a command is always available in the shell itself. You can find out how to use a function, what parameters it takes, and see examples of its usage without ever leaving the command line.

I have been using PowerShell for over a decade, and I still rely heavily on Get-Command and Get-Help to explore new modules and refresh my memory on ones I haven’t used in a while. In this post, I’ll show you how to use these tools effectively to navigate the MicrosoftFabricMgmt module.

Read on to see how you can get help. At least, on that front.

Leave a Comment

MicrosoftFabricMgmt Powershell Pipeline Operations

Rob Sewell chains together some operations:

Last week I showed you how to work with workspaces — creating, updating, removing, assigning capacities. But we were doing each operation in isolation. Today I want to show you what happens when you connect those operations together using the PowerShell pipeline.

This is one of my favourite aspects of PowerShell and therefore it was imperative that Jess Pomfret B S L and I revamped the module to fully support pipeline operations. Every cmdlet that makes sense in a pipeline is built to work in one.

Click through for some examples of what this means.

Leave a Comment

Workspace Operations with MicrosoftFabricMgmt

Rob Sewell continues a series:

The workspace is the fundamental unit of organisation in Microsoft Fabric. Everything lives inside a workspace — your lakehouses, warehouses, notebooks, pipelines, reports. Managing workspaces is therefore the first practical skill to build, and MicrosoftFabricMgmt makes it straightforward.

Read on for examples covering how to create, update, list, retrieve, or remove workspaces.

Leave a Comment

An Introduction to MicrosoftFabricMgmt

Rob Sewell has a series of posts on MicrosoftFabricMgmt. The first post provides an introduction:

I have been introducing the Microsoft fabric-toolbox — covering the toolbox itselfFUAM, and FCA. All excellent tools. But there is one item in the toolbox that I have been personally involved in building, and it is the one I am most excited to write about.

Today I am kicking off a series of posts about MicrosoftFabricMgmt — an enterprise-grade PowerShell module that gives you comprehensive, scriptable control over the entire Microsoft Fabric REST API. It is hosted as part of the fabric-toolbox on GitHub.

The second post covers installation and authentication:

Yesterday I introduced the MicrosoftFabricMgmt module and explained what it can do. Today we are getting hands on — installing the module, sorting out dependencies, and making your first connection to Microsoft Fabric.

By the end of this post you will have the module installed, be authenticated, and have your first list of Fabric workspaces in your terminal.

The third post involves not having to deal with a bunch of GUIDs:

Which workspace is 948d3445-54a5-4c2a-85e7-2c3d30933992? Which capacity? Who knows — go look it up. Multiply that by fifty items across ten workspaces and you have a frustrating afternoon ahead of you.

The PowerShell Module**MicrosoftFabricMgmt** solves some of this frustration.

Leave a Comment

The Troubles of Documentation: Microsoft Fabric API Edition

Rob Sewell walks through a recent experience:

Firstly, an apology to my friends (especially Randolph) in the documentation team at Microsoft. I know how hard you work to produce accurate and useful documentation, and I appreciate your efforts. This is not a criticism of your work, but rather an observation about the challenges I faced.

This is a story about a recent experience and the lessons learned along the way.

Read on for the issue and what Rob had to do. This is a case study in how hard it is to write good documentation, especially around the edges of what is possible.

Comments closed

Tracking Database File Sizes via Powershell

Kyle Burwell wants to know how big the databases are:

Database files (mdf, nds, ldfs, etc.) can get out of hand quickly and easily, leading to issues down the road. This can be due to improper planning, large data loads, and bad code run in production, just to list a few. As unglamorous as disk space monitoring is, we need to do our part as DBAs. This post is a quick guide on how to track database file sizes with PowerShell.

Read on for a few scripts to perform the task.

Comments closed

An Overview of the FabricTools Powershell Module

Kamil Nowinski provides an overview of the FabricTools Powershell module:

Managing Microsoft Fabric at scale quickly becomes painful if you rely only on the UI. Workspaces, capacities, and tenant-level settings all need repeatable, scriptable management. FabricTools is a community-driven PowerShell module that fills this gap by adding high‑level cmdlets focused on Microsoft Fabric and Power BI administration.​

In this post, you will learn what FabricTools is, how to install it from the PowerShell Gallery, and how to list all Fabric workspaces and export them to a CSV file for further analysis.

I was going to say “It looks a lot like DBATools” and then I realized that several of the contributors are DBATools mainstays, so that makes sense.

Comments closed

Extracting SSMS 21 and 22 Saved Connection Data

Vlad Drumea wants to keep some connections:

In this post I demo a PowerShell script that can be used to extract and decrypt SSMS 21 and 22 saved connection information.

This script builds on the one for importing saved connections from SSMS 21 to SSMS 22.
Instead of importing, it looks for any SSMS 21 and 22 related config folders, extracts the relevant connection data, decrypts it and saves it in clear text.

Click through for a link to the script, as well as an explanation of what is happening.

Comments closed

Using the trap Statement in Powershell

Patrick Gruenauer plays his trap card:

In PowerShell, error handling is a crucial aspect of writing robust and reliable scripts. One of the powerful features to manage errors gracefully is the trap statement. The trap statement allows you to define a block of code that runs whenever a terminating error occurs in your script. This can be particularly useful for logging errors, cleaning up resources. Let’s dive in.

Read on to see how it works. My preference would be to use try/catch blocks instead of trap statements, but it is interesting to see it there.

Comments closed

“The Parameter is Incorrect” with Copy-DBACredential

Jack Corbett diagnoses a problem:

I was working with a client to do an upgrade/migration from SQL Server 2016 to SQL Server 2022, and this client assigns non-default ports to SQL Server.  As part of the process, I had to create a credential on one node and needed it on the other node, so I went to the handy Copy-DBACredential dbatools cmdlet, but it didn’t work.

Read on for the troubleshooting process and the ultimate issue.

Comments closed