I have the following simple psakefile.ps1
:
Task Build {
Write-Host "Build"
}
When I invoke it using my build.ps1
:
nuget install psake -version 4.9.0
Import-Module .\psake.4.9.0\tools\psake\psake.psm1 -Force
Invoke-psake psakefile.ps1
I get an exception stating a 'default' task is required. I assumed this means I can specify 'Build' on the command line, or provide a task called 'default', so my psakefile.ps1
becomes:
Task Build {
Write-Host "Build"
}
Task default -Depends Build {
# Nothing to do, only here as a placeholder
}
But now I get a very weird exception:
Exception: Assert: '{0} references a shared task from module {1} and cannot have an action.
If I put any actual code in the 'default' task, I just get the exception saying I need a default task again.