Something like
$psakeBootstrap=".\run.ps1"$buildscript=".\default.ps1"functionSet-Tasks() {
$tasks= (Select-String-Path $buildscript-Pattern "task \w+(\-)?\w+").matches |ForEach-Object { $_.Value.Split("")[1] } |Sort-Object$taskListString= [string]::Join("','",$tasks)
$content=get-content$psakeBootstrap|ForEach-Object { $_-replace"\[ValidateSet.*\]","[ValidateSet('$taskListString')]" }
$content|Out-File-FilePath $psakeBootstrap-Encoding ascii
}
Export-ModuleMember-Function Set-Tasksand in 'run.ps1'
Remove-Module [S]et-Tasks
Import-Module".\Set-Tasks.psm1"Set-Tasks
which will just overwrite the [ValidateSet( line on itself
super hacky but just an idea
Using Psake's built-in Get-PSakeScriptTasks | Select-Object { $_.name } is probably a better idea
Something like
and in 'run.ps1'
which will just overwrite the [ValidateSet( line on itself
super hacky but just an idea
Using Psake's built-in
Get-PSakeScriptTasks | Select-Object { $_.name }is probably a better idea