We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Something like
$psakeBootstrap = ".\run.ps1" $buildscript = ".\default.ps1" function Set-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-Tasks
and 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
Get-PSakeScriptTasks | Select-Object { $_.name }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
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 ideaThe text was updated successfully, but these errors were encountered: