feat(use_order, project_issues): enhance subissue creation and improve parameter handling#189
feat(use_order, project_issues): enhance subissue creation and improve parameter handling#189
Conversation
…on for creating subissues
| [Parameter(Mandatory, ValueFromPipelineByPropertyName, ValueFromPipeline, Position = 0)][Alias("id")][string]$ItemId, | ||
| [Parameter(Mandatory, Position = 1)][string]$SubIssueUrl, | ||
| [Parameter(Mandatory, Position = 0)][string]$ItemId, | ||
| [Parameter(Mandatory, ValueFromPipeline, Position = 1)][Alias("url")][string]$SubIssueUrl, |
Check warning
Code scanning / PSScriptAnalyzer
Command accepts pipeline input but has not defined a process block. Warning
| } | ||
|
|
||
| $url = New-ProjectIssueDirect @params | ||
| Write-Host $url |
Check warning
Code scanning / PSScriptAnalyzer
File 'Add-ProjectSubIssue.ps1' uses Write-Host. Avoid using Write-Host because it might not work in all hosts, does not work when there is no host, and (prior to PS 5.0) cannot be suppressed, captured, or redirected. Instead, use Write-Output, Write-Verbose, or Write-Information. Warning
| # Add to project | ||
| if($AddToProject){ | ||
| $subissueId = Add-ProjectItem -Url $url -Owner $ProjectOwner -ProjectNumber $ProjectNumber | ||
| Write-Host $subissueId |
Check warning
Code scanning / PSScriptAnalyzer
File 'Add-ProjectSubIssue.ps1' uses Write-Host. Avoid using Write-Host because it might not work in all hosts, does not work when there is no host, and (prior to PS 5.0) cannot be suppressed, captured, or redirected. Instead, use Write-Output, Write-Verbose, or Write-Information. Warning
| } Export-ModuleMember -Function Add-ProjectSubIssueDirect | ||
|
|
||
|
|
||
| function Add-ProjectSubissueCreate { |
Check notice
Code scanning / PSScriptAnalyzer
The cmdlet 'Add-ProjectSubissueCreate' does not have a help comment. Note
| [Parameter(Position = 2)][string]$RepoName, | ||
| [Parameter(Mandatory, Position = 3)][string]$Title, | ||
| [Parameter(Position = 4)][string]$Body, | ||
|
|
Check notice
Code scanning / PSScriptAnalyzer
Line has trailing whitespace Note
Implement a new function for creating subissues and add an option to open the issue URL upon creation. Refactor parameter attributes for consistency and handle cases where specified items are not found.