F# scripts with NuGet packages

F# 5.1 finally brings joy of using NuGet packages without much hassle.This is how you can use Npgsql library to create a new  PostgreSQL database.#r "nuget: Npgsql" open Npgsql let connString = "User ID=postgres;Password=Password1!;Host=localhost;Port=5432;Database=postgres;Pooling=true;" let conn = new…

Run Azure Pipeline with REST call

You can invoke Azure Pipeline via REST API.Here's such invocation implemented with PowerShell.$creds = [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes("user:$PAT")) $basicAuth = "Basic $creds" $Headers = @{ Authorization = $basicAuth } $Payload = [PSCustomObject]@{ resources = [PSCustomObject]@{ repositories =[PSCustomObject]@{ self = [PSCustomObject] @{ refName = "refs/heads/$Branch" } } } variables…

Talk to your Windows machine with SSH!

Accessing VMs with RDP is tedious, slow and hacky DevOps way.Here's how you can set up your Windows based environment with OpenSSH.WSLUsing Windows Subsystem for Linux on client machine can be quite helpful as most of SSH related tools don't come out to Windows. I like to use…

Counting builds with Azure Pipelines

$(Rev:r) can only be used for name definitionBy default, builds are versioned with date and revision: $(Date:yyyyMMdd).$(Rev:r), eg. 20200507.42. The date changes every day (obviously), and for each day revision will start counting from 1: 20200101.1, 20200101.2, 20200102.1, and so on.$(Rev:…

Debug multiple processes in Rider