bzzzt! I Have No Idea What I'm Doing

Syncing SSAS Databases Confusion

Hello! I’ve been playing around with a PowerShell module called RunSyncRun that I’ve never quite got around to completing. What it aims to do is to execute the sync function between SSAS Databases. Part of the problem is that it takes a while to get a test environment set up, but I finally got the WideWorldImporters sample project up and running as a good place to start. The crux of the whole module is to run this relatively small piece of xmla found in StartDatabaseSync -

But wait! There's more!

The Mystery Of The Failing Azure Cmdlet

Hello! I’ve been helping out a team with setting up a deployment pipeline that uses Azure Data Lake Store, and so the obvious way to do this is to make use of the AzureRM.DataLakeStore PowerShell module. For those of you not ITK, Microsoft provide a set of PowerShell cmdlets that make use of the Azure Resource Manager model for managing Azure resources. These can be downloaded via the PowerShell Gallery. And because there are a fairly large amount of cmdlets, these are split into subsets, such as the aforementioned AzureRM.

But wait! There's more!

On The Move

This is the first post in earnest as I begin the arduous task of migrating away from BlueHost/WordPress and their paid services to a free static web site.

Write-Host "I have no idea what I am doing."

PowerShell Snippet #12 - Creating Arrays of HashTables in PowerShell

Hello! As part of SQLDWSchemaMigrate there is a function called Compare-Rows, which finds if there is a difference between the number of columns for a given table that exists on both source and target tables. And I need to return a hash table of the schema/table where there is a mismatch wrt column count. What makes this a challenge is that hash tables cannot store duplicate keys. I was setting the key to the schema name, so theoretically I could just set the value to the schema and the key to the table.

But wait! There's more!

Execute Multiple Files Using SQLCMD or SQLClient - Which Is Faster?

Hello! I’ve been working on a PowerShell module that will migrate the schema of an Azure Data Warehouse from one database to another. The process has through quite a few iterations, and at one point I was heavily using sqlcmd utility to execute each “CREATE [OBJECT]” statement. Whilst this proved effective when playing around with a small database, when I tested the module against a real ADW it became clear that this process was far too slow.

But wait! There's more!

PowerShell Snippet #11 - PsBoundParams

Hello! There are many things I like about PowerShell, one of which is the automatic variables that are created. For example, $PsScriptRoot is set to the location of the running script (and if you run $PsScriptRoot in a .psm1 file, it sets $PSScriptRoot as the path of the file as opposed to the script.) And one of the automatic variables that I recently discovered is “PsBoundParams”. This handy little variable is a hash table that keeps track of what parameters have had arguements passed to them in either a script of a function.

But wait! There's more!

Deploy Dacpacs with dbatools The Script

Hello! Not so long ago, I wrote about how dbatools now has functions that can be used to deploy dacpacs. What I didn’t actually include was a script to do same, so without further ado, below is a script that makes use of Publish-DbaDacpac - There is also a -Verbose option. But even without it a successful deployment will spit out quite a bit of information - And of course, if you run Get-Help Publish-DbaDacpac, you get the built in help -

But wait! There's more!

SSISMSBuild Updated

Hello! 3 updates in one week?! It appears that though I took some holiday and didn’t even so much as touch a PC over the Christmas/New Years season, other people were still working hard. SSISMSBuild is a project that has had a long life. In short, you can build ispac projects without needing Visual Studio, however you do need Integration Services installed. Broadly speaking the project is not mine, I’m just hosting it.

But wait! There's more!

Alter PowerShell ModuleVersion Number - More Bug Fixes!

Hello! Another day, another bug. This time in a VSTS extension I wrote that would alter the ModuleVersion Number in a psd1 file. Sadly I didn’t test this against psd1 files that have required modules, so the ModuleVersion numbers were updated for those also! This is helpful to precisely no one, so I made a minor change in how the ModuleVersion is found. Link to GitHub Issue. The bug itself is fixed as of 1.

But wait! There's more!

salt Release 1.1.2562 - With Bug Fix!

Hello! Very recently a user of salt got in touch with me about a bug when setting the job schedules up - when creating a schedule an owner is created. And only the owner (or sysadmin) can modify the schedule. So if the deployment account is not sysadmin then it needs to be the owner of the schedule. Problem An owner is identified by a SID, which is stored in a varbinary column in SQL Server, so when we set the SID variables in PowerShell they are stored as byte arrays.

But wait! There's more!