Adapted for Invoke-Build 2.0.0.