Press "Enter" to skip to content

Month: May 2021

Understanding the PipelineVariable

Chad Baldwin shows off the PipelineVariable parameter:

PowerShell has been a daily tool for me for at least 5 or 6 years at this point, so when I learn something new that seems fairly useful I figure it’s probably worth writing about. These posts also help me remember because they force me to do more research into it than I normally would.

TIL (Today I Learned) about the -PipelineVariable parameter in PowerShell, known as a “Common Parameter”; which are automatically added by PowerShell to cmdlets that are decorated with the [cmdletbinding()] attribute.

This is by no means a “new” feature, -PipelineVariable was added as a common parameter in 2017 for version v4.0.

Read on for a clear explanation of how it works and where it can be useful.

Comments closed

Querying the SQL Server Backup History

Chad Callihan takes us through our sordid pasts:

What do you do when you want to check the history of your database backups? Do you look at a drive containing your backups? Do you have software like Netbackup for you to open and review? My preference is to run a query in SSMS to get a quick overview.

With a couple tweaks this versatile script can be helpful in a variety of scenarios. You can check a single database, an entire SQL server, or multiple SQL servers. Here is how I use this type of script that queries the backupset table and backupmediafamily table in msdb. I recommend checking out these two tables because there are some good column options that you may want to include when reviewing backups. If you’re feeling dangerous, just modify the scripts below to be SELECT * and see what you get.

Click through for the scripts.

Comments closed

Network Configuration with Powershell

Patrick Gruenauer shows how to configure network settings on a Windows machine using Powershell:

Today I would like to give a tutorial for a basic network configuration on Windows systems using PowerShell. We start with a fresh installation of a Windows operating system.

Read on for a fairly simple example, one which lays out the foundation for more complicated scenarios such as configuring networking settings for an Availability Group.

Comments closed

Taskbar Management with Powershell

Jeffrey Hicks shows how you can use Powershell to manage Windows 10 taskbar settings:

When I’m working on a Pluralsight course, I tend to setup a virtual machine for recording. Although, lately I’ve been trying with Windows 10 Sandbox. This is handy when all I need is a Windows 10 desktop. When I setup the system, I have particular settings I need to configure. Naturally I use a PowerShell script to automate the process. One item that I wanted to address was Windows 10 taskbar. When I’m recording a course, I like to have it auto-hide. Sure, I could manually set it. But that’s no fun.

After a little online research I came across this page. In addition to the manual steps, the author also provided a snippet of PowerShell code! I assumed there would be registry setting I could configure and was hoping to find that. But this was even better. The author’s code was written to be used from a CMD prompt to invoke a few PowerShell commands. But since I’m already using PowerShell for my desktop configuration, I took his code and created re-usable PowerShell functions.

Read on for a lengthy but helpful script.

Comments closed

Percentages in Execution Plans

Hugo Kornelis shares some information with us:

A lot of information you see when looking at execution plan is shown as a percentage. And those percentages are often the first thing that draws our attention. So it’s really important to know what those values are. And yet, I had forgotten to include coverage for percentages in my training videos. And you’ll also not find those percentages mentioned in the Execution Plan Reference. Why? Simple. They don’t exist.

It is here that I imagine a short silence. Followed by a huge outburst. “What? Of course they exist! I look at them every day!”

Read on to see what Hugo means, and also check out the video training course.

Comments closed

Data Pipeline Error Handling with Apache NiFi

Pieter Humphrey gives us a few techniques for handling data pipeline errors when running Apache NiFi:

The more complex the model, the more possible sources of problems exist. Forecasting every single potential problem is, of course, impossible. Identifying the most important ones and providing self-solving solutions can greatly reduce the operational uncertainty of our NiFi pipeline and improve its robustness.

To see how to do this analysis, we will consider four possible strategies: one external and three internal. They certainly do not cover all potential error scenarios, they are just examples that we can extrapolate from, and inform how to handle other potential failure domains.

Click through for an overview of the topic as well as those four techniques.

Comments closed

Connectivity Modes for Cosmos DB

Hasan Savran takes us through two ways to connect to Cosmos DB:

 There are two ways to connect to the Azure Cosmos DB. You need to specify the way you want to connect to Azure Cosmos DB in SDK. The way that you pick for connectivity mode can make a big difference for your application’s performance. 

     First connectivity mode is Gateway Mode. This is the default way to connect Azure Cosmos DB in earlier version of SDK platforms. This method is mostly for applications that stays behind corporate firewall or It is for environments that have a limited number of socket connections. If your company have strict firewall restrictions, Gateway mode is the way to go for sure. Gateway mode uses standard HTTPS port and single endpoint.

Read on for the second mode, as well as the pros and cons of using each mode.

Comments closed

Azure Purview Support for Azure SQL Database Views

Wolfgang Strasser looks at a new feature in Azure Purview:

There was one big thing missing so far – the scanning of SQL Server / Azure SQL Views. Which – well – in many cases (customer databases) was a huge loss of information in the data catalog.

This known limitation is listed on the documentation page but many of us overread this sentence.

But check out Wolfgang’s most recent finding and it’s clear that the team is working on it.

Comments closed

So You Want Database Documentation

Joey D’Antoni gives us a primer on database documentation techniques:

Although writing better queries and building the right indexes are important parts of improving database performance, building clear database documentation can also contribute to this goal by helping you understand your database architecture. Painting a clear picture of the structure of your database gives you insight into your data flows and helps you identify redundant data and clarify business processes.

Let’s take a look at a few approaches you can take to documenting your database and your data, depending on the nature of your application.

I do like the idea of using extended properties for documentation purposes, though for the longest time, the tooling to show those extended properties was fairly limited and it was easy to miss them on scripting.

Comments closed