Author Archives: GrahamTheCoder

About GrahamTheCoder

I'm a C# developer based in Cambridge hoping blogging will achieve some or all of the following. Help me organise my thoughts. Practice writing things other than code. Give me a place to refer people to when I'm trying to make a long winded point. I welcome comments and constructive criticism, and hope to look back at my written opinions in the future and laugh at my own naivety.

Listing .NET assembly versions in powershell

Sometimes in .NET you end up in assembly version hell. When you’re trying to get your assembly references and binding redirects right, this function can really come in handy, it works directly on a file, or on directories and has … Continue reading

Posted in Build, C#, Note to self | Tagged | Leave a comment

PS Remove directory atomically

Remove-Item -recurse in Powershell isn’t atomic. If a file is locked in the directory, you’ll end up with half of the files deleted, but not the locked one. Sometimes that just isn’t ok, like during an octopus deployment, so I … Continue reading

Posted in Note to self | Tagged , | Leave a comment

Download packages from Octopus

It’s not recommended to download packages from Octopus programmatically. You should set up a separate feed instead ideally. But…if you really need to right now and don’t have time for that, chuck this into a Download-Package.ps1 file: Param($OctopusUrl, $ApiKey, $PackageName) … Continue reading

Posted in Note to self | Leave a comment