Press "Enter" to skip to content

Category: Powershell

Configuring a New Windows Device via Chocolatey

Reitse Eskens writes a script:

Last month, my company got me a new laptop. I have very little choice in which one I get, and I have to reinstall a lot of software. So, what to do next?

Click through for an example of such an installation script. Having one or more Chocolatey scripts does help, especially for fairly stable corporate machines. I’ve found it to be moderately useful for home devices, where I tend to cycle through software a bit more frequently. But it does make the process of rebuilding a Windows-based machine less painful.

On the Linux side, this is more built-in. For anything via repo managers (such as apt or yum), you can list your installed packages and turn that into a script. It’s a similar story for snap or flatpak packages, though maybe a little bit less conveneint. For AppImage files or deb/rpm files you installed separately from the repo, it’s a bit more of a mixed bag.

Leave a Comment

Managing Eventhouses and Environments with MicrosoftFabricMgmt

Rob Sewell continues a series on the MicrosoftFabricMgmt module. First up is a dive into the Kusto world:

Real-Time Intelligence (RTI) is Microsoft Fabric’s answer to streaming data workloads. If you are ingesting telemetry, IoT data, clickstreams, or any high-velocity data that needs querying with low latency, this is the part of Fabric you want. MicrosoftFabricMgmt supports the full set of RTI resources: Eventhouses, KQL Databases, KQL Dashboards, KQL Querysets, and Eventstreams.

Rob then pivots to creating an environment from scratch:

Over the past few posts we have worked through a number of the item choices that you can use in the MicrosoftFabricMgmt module. Today I want to bring it all together into a single, practical script that provisions a complete Fabric environment from scratch.

This is the kind of script I could use when setting up a new project. It is repeatable, idempotent (safe to run multiple times), fully logged, and handles errors gracefully.

Leave a Comment

Logging and Error Handling with MicrosoftFabricMgmt

Rob Sewell continues a series on the MicrosoftFabricMgmt Powershell module. First up is structured logging:

If you have ever come back to a script the next morning and thought “what on earth happened last night?”, you understand why logging matters. Write-Host and Write-Verbose are fine for interactive use, but in automation — scheduled tasks, CI/CD pipelines, long-running jobs — you need something more structured. Something you can query, filter, and persist across sessions, something that you can provide to your team or support or auditors.

MicrosoftFabricMgmt uses PSFramework for all its internal logging, and that capability is available directly to you.

Then comes retry logic and dealing with long-running operations:

REST APIs fail. Networks are unreliable. Cloud services have rate limits. If your automation script does not account for this, it will eventually break at the worst possible moment. This is not pessimism — it is production experience.

MicrosoftFabricMgmt has a lot of error handling built in, so you do not have to write it all yourself. Today I want to show you what the module handles automatically, and how to add your own handling on top for the scenarios you care about.

Leave a Comment

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.

Comments closed

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.

Comments closed

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.

Comments closed

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.

Comments closed

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