Category Archives: Note to self

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