New Year tech clean up

Well as another weird year begins I’ve managed to break some time off to do a bit of housekeeping. I’ve remove some old forks, added licenses, tags etc. I’ve also been renaming the default branch to main. git branch -m master main git fetch origin git branch -u origin/main main

January 17, 2021 · 1 min · matt40k

Invoke-SqlCmd Failing

A really annoying problem I hit recently with a some Azure Runbooks was the following message occuring: Invoke-Sqlcmd : The WriteObject and WriteError methods cannot be called from outside the overrides of the BeginProcessing, ProcessRecord, and EndProcessing methods, and they can only be called from within the same thread. Validate that the cmdlet makes these calls correctly, or contact Microsoft Customer Support Services. After doing some digging, I found out that Invoke-SqlCmd isn’t thread safe, so other runbooks running on that Azure Automation account, could interfere with each other....

July 16, 2020 · 2 min · matt40k

Troublesome CSV

Another day, another source of bad data. This time, it was a CSV. As you can see, the format changes mid file. This makes importing tricky. The way I tend to handle importing into SQL is to create staging tables with all the columns defined as varchar, then, once its imported into SQL, then convert it. The problem occurs when you try to determine the number of columns required. Traditionally, we let the system auto determine how many columns we have, and if we have headers, define the names, unfortunately because the format changes we can’t do this otherwise it will ignore the additional columns - assuming the first row doesn’t contain all the columns....

December 3, 2017 · 1 min · matt40k

SSRS 2016 by default

For the past 4 months I’ve been using Visual Studio 2015 rather then Visual Studio 2013 and yesterday, I hit a bug with SSRS (shows how much I love SSRS). The bug appeared when it came to deployment The error was deploying SSRS report Exception calling “CreateCatalogItem” with “7” argument(s): “The definition of this report is not valid or supported by this version of Reporting Services. The report definition may have been created with a later version of Reporting...

January 10, 2017 · 2 min · matt40k

Comments

One of the annoying things about working with multiple languages is they each have their differences – obviously, otherwise there would only be 1 language! Although there is good reason to have these differences they still have elements that are a pain. One of the most annoying things, other then “do you require a semicolon at the end of the statement?” is comments. Comments aren’t executed or complied but they help developers read code....

October 16, 2016 · 2 min · matt40k

Using PowerShell to check setup

So I was handed over some new servers, before I got started I wanted to check everything was as it was suppose to be, so I wrote a few PowerShell scripts to check each server was setup correctly. I wanted my DEV to 100% match my UAT and so on. First, I wanted to check who has local administrator access on the servers. Next, I wanted to check the drives – I wanted to make sure each drive letter was the same across environments and all had a proper label....

December 9, 2015 · 1 min · matt40k

The term ‘Invoke-WebRequest’ is not recognized

I’ve currently been working on a PowerShell script to build a virtual server using DigitalOceanexcellent RESTful API. So far this has gone extremely well and I have been impressed with both PowerShell and DigitalOcean’sAPI. Today however I tried running on another machine (an important part of development) only to find it doesn’t work. The first error that appears is: The term ‘Invoke-WebRequest’ is not recognized as the name of a cmdlet, function, script file, or operable progr...

July 23, 2014 · 2 min · matt40k