Conversation
… Remove-Item function
…ing Owner and ProjectNumber
…to support NoCache option
|
|
||
| } | ||
|
|
||
| function Remove-Item{ |
Check warning
Code scanning / PSScriptAnalyzer
'Remove-Item' is a cmdlet that is included with PowerShell (version core-6.1.0-windows) whose definition should not be overridden Warning
|
|
||
| } | ||
|
|
||
| function Remove-Item{ |
Check warning
Code scanning / PSScriptAnalyzer
Function 'Remove-Item' has verb that could change system state. Therefore, the function has to support 'ShouldProcess'. Warning
| Save-ProjectDatabase -Database $db | ||
| } | ||
|
|
||
| function Remove-ProjectItem{ |
Check warning
Code scanning / PSScriptAnalyzer
Function 'Remove-ProjectItem' has verb that could change system state. Therefore, the function has to support 'ShouldProcess'. Warning
| begin{ | ||
| ($Owner,$ProjectNumber) = Get-OwnerAndProjectNumber -Owner $Owner -ProjectNumber $ProjectNumber | ||
| if([string]::IsNullOrWhiteSpace($owner) -or [string]::IsNullOrWhiteSpace($ProjectNumber)){ "Owner and ProjectNumber are required" | Write-MyError; return $null} | ||
|
|
Check notice
Code scanning / PSScriptAnalyzer
Line has trailing whitespace Note
| ($Owner,$ProjectNumber) = Get-OwnerAndProjectNumber -Owner $Owner -ProjectNumber $ProjectNumber | ||
| if([string]::IsNullOrWhiteSpace($owner) -or [string]::IsNullOrWhiteSpace($ProjectNumber)){ "Owner and ProjectNumber are required" | Write-MyError; return $null} | ||
|
|
||
|
|
Check notice
Code scanning / PSScriptAnalyzer
Line has trailing whitespace Note
| } | ||
| if($null -eq $item){ | ||
| "Item [$ItemId] not found in cache, fetching from API" | Write-Verbose | ||
|
|
Check notice
Code scanning / PSScriptAnalyzer
Line has trailing whitespace Note
| Set-ProjectItem -Owner $Owner -ProjectNumber $ProjectNumber -Item $item | ||
| return $item | ||
| } | ||
|
|
Check notice
Code scanning / PSScriptAnalyzer
Line has trailing whitespace Note
| begin{ | ||
| ($Owner,$ProjectNumber) = Get-OwnerAndProjectNumber -Owner $Owner -ProjectNumber $ProjectNumber | ||
| if([string]::IsNullOrWhiteSpace($owner) -or [string]::IsNullOrWhiteSpace($ProjectNumber)){ "Owner and ProjectNumber are required" | Write-MyError; return $null} | ||
|
|
Check notice
Code scanning / PSScriptAnalyzer
Line has trailing whitespace Note
No description provided.