Office

Copy Excel to CSV with PowerShell

Posted on

Having opened up the same Excel spreadsheet to save the data as a CSV for the third time, I wrote a PowerShell script to do it for me. Simply set the source and destination files and the script takes care of the rest. & { $sourceFile = “C:\Temp\data.xlsx” $outFile = “C:\Temp\data.csv” $excelApplication = New-Object -ComObject […]

Programming

Convert a SQL SELECT into an INSERT Script

Posted on

Sometimes you want to generate an INSERT script from existing data, perhaps with one or two values tweaked. It’s a pain to hand-crank the INSERT when you can see exactly what you want using a SELECT statement. It’s also a bit long-winded to use SQL import/export wizards or other tools. Sometimes, you just want to […]

Programming

Check Certificate Expiry Date in .NET Core

Posted on

I needed to check the certificate expiry date in an NUnit test. The below snippet can be used to check any certificate properties, using a custom certificate validation callback. All you need to do is read the properties you are interested in within the callback so you can check them afterwards. DateTime notAfter = DateTime.UtcNow; […]