Saturday, April 14, 2012

Redirecting all output from a PowerShell script using the new PowerShell 3.0 asterisk / star / * redirection:


powershell -Command { .\scriptfile.ps1 *> out.log }

Other types of redirection:
  • Pipeline: 1
  • Error: 2
  • Warning: 3
  • Verbose: 4
  • Debug: 5
  • All streams: *

Thursday, April 5, 2012

NuGet and Semantic Versioning

NuGet version 1.6 introduced support for Semantic Versioning, however I have since discovered that NuGet only supports v1.0.0 of the SemVer specification. Unfortunately, this is much more limiting than the latest version, which supports more and better scenarios such as continuous integration builds.

Semantic versions in NuGet must match the following regular expression:


(?\d+(\.\d+){2})(?-[a-z][0-9a-z-]*)?

This means a version number with three components (e.g. 1.0.0) optionally followed by a pre-release version number. The pre-release version number must start with a dash (-) and a letter between a-z, and can then be any number of digits, letters and dashes (-). The regular expression is case insensitive.

For example,

  • 0.1.0
  • 0.1.0-alpha
  • 0.1.0-Alpha
  • 0.1.0-a-2