Prototyping with PowerShell

Requirements, specification, design and implementation Requirement We have two NuGet servers. The primary server is locally hosted for the developers. The second server is an Azure DevOps NuGet feed for contractors typically working outside the firewall. A scheduled task synchronizing the two servers runs hourly, copying any new packages from the local server to the … Continue reading Prototyping with PowerShell

A NuGet List item parser – Part 2: Including Pre-release packages

In Part 1 I reorganised my NuGet source synchronization tool's code to make it testable, with the specific aim of allowing pre-release packages to be synchronized. In particular, the affected code was isolated into this function: function Parse-PackageItem { param( [string]$Package ) $idVer = $Package.Split(' ') if ($idVer.Length -eq 2) { $id = $idVer[0] [string]$ver … Continue reading A NuGet List item parser – Part 2: Including Pre-release packages

A NuGet List item parser – Part 1: Making legacy code testable

I am building a tool to synchronize two NuGet servers. One is hosted on a development server, and the other is in the cloud. I need to add support for Pre-Release packages. In the first of two parts, I refactor the code to make it testable. The existing code This tool started its life as … Continue reading A NuGet List item parser – Part 1: Making legacy code testable

Parameterizing Scripts with PowerShell Data Files

In my previous blogĀ I introduced the Get-Blacklist function which turned a string array into a hashtable for quick comparisons: function Get-Blacklist { param( [string[]]$Blacklist ) $blacklistHash = @{} $Blacklist | % { $blacklistHash[$_] = $true } $blacklistHash } and invoked it thus: . .\Scripts\Get-Blacklist.ps1 @blacklist = Get-Blacklist -Blacklist 'Powershell','Sandbox','sqlccJamie','Graphics','CentinelTest','Backoffice Service Portal' As a rule I … Continue reading Parameterizing Scripts with PowerShell Data Files