Posts for: #PowerShell

Creating Multiple Files with Content Using PowerShell

Creating Multiple Files with Content Using PowerShell

This post aims to explain a straight forward yet effective PowerShell functionality which can help the user in creating more than one file with specified content.

This can be useful for developers, system administrators or any user who wishes to generate files quickly for testing purposes or something else.

The PowerShell Function

Here’s a PowerShell function that allows you to create a specified number of files in a folder, with the option to include custom content.

Read more →

Deterministic masking with dbatools

The dbatools module recently got a couple of new commands mask data in their databases. One feature with the masking commands that were not yet put in was deterministic masking.

What is deterministic masking

Deterministic masking is the process of replacing a value in a column with the exact value across tables. For example, a database has multiple tables with a column that has first names. With deterministic masking, the first name that’s present will always be replaced with the same value.

Read more →

SQL Tuesday #110 Deterministic masking with dbatools

The dbatools module recently got a couple of new commands mask data in their databases. One feature with the masking commands that were not yet put in was deterministic masking.

What is deterministic masking

Deterministic masking is the process of replacing a value in a column with the exact value across tables.

For example, a database has multiple tables with a column that has first names. With deterministic masking, the first name that’s present will always be replaced with the same value.

Read more →

Decrypting SQL Server Objects with dbatools

There are lots of great articles that describe how the command for decrypting SQL Server objects when they’re saved with encryption like Encrypting and Decrypting SQL Server Stored Procedures, Views, and User-Defined Functions Simple Way to Decrypt SQL Server Stored Procedure

Most of them rely on T-SQL and SSMS but I wanted to do the same thing with PowerShell. This way I can execute it for several objects at a time and maybe even in multiple databases and instances.

Read more →

Log Shipping With dbatools – Part 4: Recover a Log Shipped Database

In the third part of the series we discussed the way to get the log shipping errors using the command “Get-DbaLogShippingError”.

This blog will be about how to recover a log shipped database.

Out-of-the-box solutions

I can be very short in this paragraph, there is no out-of-the-box solution to recover a log shipped database.

Why this command

Initially, log shipping was meant to be used as a warm standby. You have your data on another instance but you still have some human intervention to get it all back up. Imagine the following situation. You have set up log shipping using either the GUI or the commands in dbatools.

Read more →