Skip to content

Conversation

@rulasg
Copy link
Owner

@rulasg rulasg commented Jan 19, 2026

Improve the Update-ProjectRecent function to handle recent update queries more effectively. This includes modifications to the query logic and the addition of new test cases to ensure proper functionality.

# Act - use the mock to run the project full sync to set the last recent update to today
MockCall_GetProject_700

$result = Update-ProjectRecent -Owner $owner -ProjectNumber $projectNumber

Check warning

Code scanning / PSScriptAnalyzer

The variable 'result' is assigned but never used. Warning

The variable 'result' is assigned but never used.
return $last
}

function Set-EnvItem_Last_RecentUpdate{

Check warning

Code scanning / PSScriptAnalyzer

Function 'Set-EnvItem_Last_RecentUpdate' has verb that could change system state. Therefore, the function has to support 'ShouldProcess'. Warning

Function 'Set-EnvItem_Last_RecentUpdate' has verb that could change system state. Therefore, the function has to support 'ShouldProcess'.

}

function Set-EnvItem_Last_RecentUpdate_Today{

Check warning

Code scanning / PSScriptAnalyzer

Function 'Set-EnvItem_Last_RecentUpdate_Today' has verb that could change system state. Therefore, the function has to support 'ShouldProcess'. Warning

Function 'Set-EnvItem_Last_RecentUpdate_Today' has verb that could change system state. Therefore, the function has to support 'ShouldProcess'.
# Arrange
$p = Get-Mock_Project_700 ; $owner = $p.owner ; $projectNumber = $p.number
$d = Get-Mock_Today ; $today = $d.today ; $pastDate = $d.past

Check notice

Code scanning / PSScriptAnalyzer

Line has trailing whitespace Note

Line has trailing whitespace
} Export-ModuleMember -Function Update-ProjectRecent

function Set-EnvItem_Last_RecentUpdate_Today{
function Get-UpdateRecentQuery{

Check notice

Code scanning / PSScriptAnalyzer

The cmdlet 'Get-UpdateRecentQuery' does not have a help comment. Note

The cmdlet 'Get-UpdateRecentQuery' does not have a help comment.
}
# If no last update return no filter to update all
if ($null -eq $last){
return ""

Check notice

Code scanning / PSScriptAnalyzer

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

The cmdlet 'Get-UpdateRecentQuery' returns an object of type 'System.String' but this type is not declared in the OutputType attribute.
@rulasg rulasg merged commit 2c9231f into main Jan 19, 2026
3 checks passed
@rulasg rulasg deleted the update-project-recent branch January 19, 2026 15:46
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