Skip to content

feat(Resolve-ProjectParameters): Remove sticky project environment setting#199

Merged
rulasg merged 13 commits intomainfrom
resolve-project-environment
Feb 25, 2026
Merged

feat(Resolve-ProjectParameters): Remove sticky project environment setting#199
rulasg merged 13 commits intomainfrom
resolve-project-environment

Conversation

@rulasg
Copy link
Owner

@rulasg rulasg commented Feb 25, 2026

Before when running a command with owner and ProjectNumber parametesr it will cache the parameters for later use.

We have removed this sticky cache and force to call Set-ProjectParameter to make owner and PN parameters values defaut.

This allows a user to work across two projects easilly

@@ -0,0 +1,59 @@
function Resolve-ProjectParameters {

Check warning

Code scanning / PSScriptAnalyzer

The cmdlet 'Resolve-ProjectParameters' uses a plural noun. A singular noun should be used instead. Warning

The cmdlet 'Resolve-ProjectParameters' uses a plural noun. A singular noun should be used instead.
return ($Owner, $ProjectNumber)
}

function Test-ProjectParameters {

Check warning

Code scanning / PSScriptAnalyzer

The cmdlet 'Test-ProjectParameters' uses a plural noun. A singular noun should be used instead. Warning

The cmdlet 'Test-ProjectParameters' uses a plural noun. A singular noun should be used instead.
return -not ([string]::IsNullOrWhiteSpace($Owner) -or [string]::IsNullOrWhiteSpace($ProjectNumber))
}

function Set-ProjectParameters {

Check warning

Code scanning / PSScriptAnalyzer

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

Function 'Set-ProjectParameters' has verb that could change system state. Therefore, the function has to support 'ShouldProcess'.
return -not ([string]::IsNullOrWhiteSpace($Owner) -or [string]::IsNullOrWhiteSpace($ProjectNumber))
}

function Set-ProjectParameters {

Check warning

Code scanning / PSScriptAnalyzer

The cmdlet 'Set-ProjectParameters' uses a plural noun. A singular noun should be used instead. Warning

The cmdlet 'Set-ProjectParameters' uses a plural noun. A singular noun should be used instead.
function Test_AddComment_SUCCESS_Using_Direct{

$p = Get-Mock_Project_700
$p = Get-Mock_Project_700

Check notice

Code scanning / PSScriptAnalyzer

Line has trailing whitespace Note

Line has trailing whitespace

# Act
$result = Get-ProjectIssue -Url $i.url
$result = Get-ProjectIssue -Url $i.url

Check notice

Code scanning / PSScriptAnalyzer

Line has trailing whitespace Note

Line has trailing whitespace

($Owner, $ProjectNumber) = Resolve-ProjectParameters -Owner $Owner -ProjectNumber $ProjectNumber -DoNotThrow

return -not ([string]::IsNullOrWhiteSpace($Owner) -or [string]::IsNullOrWhiteSpace($ProjectNumber))

Check notice

Code scanning / PSScriptAnalyzer

The cmdlet 'Test-ProjectParameters' returns an object of type 'System.Boolean' but this type is not declared in the OutputType attribute. Note

The cmdlet 'Test-ProjectParameters' returns an object of type 'System.Boolean' but this type is not declared in the OutputType attribute.
return -not ([string]::IsNullOrWhiteSpace($Owner) -or [string]::IsNullOrWhiteSpace($ProjectNumber))
}

function Set-ProjectParameters {

Check notice

Code scanning / PSScriptAnalyzer

The cmdlet 'Set-ProjectParameters' does not have a help comment. Note

The cmdlet 'Set-ProjectParameters' does not have a help comment.
throw "Issue not removed properly"
# Check that issue was part of the returned repo url
if($issue.url.StartsWith($repourl)){
return $true

Check notice

Code scanning / PSScriptAnalyzer

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

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

# Find Item to remove
$item = Get-ProjectItem -ItemId $ItemId
$item = Get-ProjectItem -ItemId $ItemId -Owner $Owner -ProjectNumber $ProjectNumber

Check notice

Code scanning / PSScriptAnalyzer

Line has trailing whitespace Note

Line has trailing whitespace
@rulasg rulasg merged commit c89a57d into main Feb 25, 2026
3 checks passed
@rulasg rulasg deleted the resolve-project-environment branch February 25, 2026 16:57
@rulasg rulasg linked an issue Feb 25, 2026 that may be closed by this pull request
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.

[ProjectHelper] Remove sticky project info to enviroment

1 participant