Skip to content

refactor and fix various functions for improved logging and pipeline support - #151

Merged
rulasg merged 14 commits into
mainfrom
show-projectitem
Oct 3, 2025
Merged

refactor and fix various functions for improved logging and pipeline support#151
rulasg merged 14 commits into
mainfrom
show-projectitem

Conversation

@rulasg

@rulasg rulasg commented Oct 3, 2025

Copy link
Copy Markdown
Owner

Enhance logging consistency and add support for ValueFromPipelineByPropertyName in several functions. Update the FindProject query structure to include additional fields. Introduce helper functions for managing test transcripts.

@rulasg
rulasg enabled auto-merge October 3, 2025 07:23
Assert-AreEqual -Expected $title -Presented $result0[0].Title

$result1 = $item | Show-ProjectItem -Attributes "id","Title","Status"

Check notice

Code scanning / PSScriptAnalyzer

Line has trailing whitespace Note

Line has trailing whitespace
Comment thread include/MyWrite.ps1
if ($null -eq $Object) {
return "null"
}

Check notice

Code scanning / PSScriptAnalyzer

Line has trailing whitespace Note

Line has trailing whitespace
Comment thread include/MyWrite.ps1
if ($Object -is [string]) {
return $Object
}

Check notice

Code scanning / PSScriptAnalyzer

Line has trailing whitespace Note

Line has trailing whitespace
$params.OutFile = $OutFile
}

">> $Method $Uri" | Write-MyDebug -section "invokeRestMethod"

Check notice

Code scanning / PSScriptAnalyzer

Line has trailing whitespace Note

Line has trailing whitespace

">> $Method $Uri" | Write-MyDebug -section "invokeRestMethod"
$result = Microsoft.PowerShell.Utility\Invoke-RestMethod @params
"<< $Method $Uri" | Write-MyDebug -section "invokeRestMethod"

Check notice

Code scanning / PSScriptAnalyzer

Line has trailing whitespace Note

Line has trailing whitespace
[Parameter()][string]$ProjectNumber,
[Parameter()][string[]]$DisplayFields
[Parameter(ValueFromPipelineByPropertyName)][string]$Owner,
[Parameter(ValueFromPipelineByPropertyName)][string]$ProjectNumber,

Check warning

Code scanning / PSScriptAnalyzer

Command accepts pipeline input but has not defined a process block. Warning

Command accepts pipeline input but has not defined a process block.
[Parameter()][string[]]$DisplayFields
[Parameter(ValueFromPipelineByPropertyName)][string]$Owner,
[Parameter(ValueFromPipelineByPropertyName)][string]$ProjectNumber,
[Parameter(ValueFromPipelineByPropertyName)][string[]]$DisplayFields

Check warning

Code scanning / PSScriptAnalyzer

Command accepts pipeline input but has not defined a process block. Warning

Command accepts pipeline input but has not defined a process block.
Comment thread public/project_item.ps1

function Add-Attributes{

function Show-ProjectItem{

Check notice

Code scanning / PSScriptAnalyzer

The cmdlet 'Show-ProjectItem' does not have a help comment. Note

The cmdlet 'Show-ProjectItem' does not have a help comment.
Comment thread public/project_item.ps1
if ($PSCmdlet.ShouldProcess($ItemId, "RRemove from project $Owner/$ProjectNumber")) {
$response = Invoke-MyCommand -Command RemoveItemFromProject -Parameters @{ projectid = $projectId ; itemid = $ItemId }
} else {
return $ItemId

Check notice

Code scanning / PSScriptAnalyzer

The cmdlet 'Remove-ProjectItemDirect' returns an object of type 'System.String' but this type is not declared in the OutputType attribute. Note

The cmdlet 'Remove-ProjectItemDirect' returns an object of type 'System.String' but this type is not declared in the OutputType attribute.
Comment thread public/project_item.ps1
$fields | Write-Verbose
}
# $fields | Write-Verbose
# }

Check notice

Code scanning / PSScriptAnalyzer

Line has trailing whitespace Note

Line has trailing whitespace
@rulasg
rulasg merged commit d671e45 into main Oct 3, 2025
3 checks passed
@rulasg
rulasg deleted the show-projectitem branch October 3, 2025 07:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants