Skip to content

Comments

Update Get-SfAccount and Get-SfOpportunity functions with ID support and add URL ID extraction#22

Merged
rulasg merged 3 commits intomainfrom
getsf-with-id
Apr 21, 2025
Merged

Update Get-SfAccount and Get-SfOpportunity functions with ID support and add URL ID extraction#22
rulasg merged 3 commits intomainfrom
getsf-with-id

Conversation

@rulasg
Copy link
Owner

@rulasg rulasg commented Apr 21, 2025

Enhance the Get-SfAccount and Get-SfOpportunity functions to accept an ID parameter, allowing users to query directly by ID. Introduce a new function, Get-SfIdFromUrl, to extract IDs from Service Fabric URLs. Update documentation and tests accordingly.

# PowerShell module to get the ID from a Service Fabric URL
# Allow to integrate with ProjectHelper returning SfId

function Get-SfIdFromUrl{

Check notice

Code scanning / PSScriptAnalyzer

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

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

# Extract Id from URL
$Id = Get-SfObjectIdFromUrl -SfUrl $SfUrl

Check notice

Code scanning / PSScriptAnalyzer

Line has trailing whitespace Note

Line has trailing whitespace
$ret = @{
SfId = $Id
}

Check notice

Code scanning / PSScriptAnalyzer

Line has trailing whitespace Note

Line has trailing whitespace
SfId = $Id
}

return $ret

Check notice

Code scanning / PSScriptAnalyzer

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

The cmdlet 'Get-SfIdFromUrl' returns an object of type 'System.Collections.Hashtable' but this type is not declared in the OutputType attribute.
if ($type -ne "Account") {
throw "Invalid Salesforce Object URL $SfUrl"
if ([string]::IsNullOrWhiteSpace($Id)){

Check notice

Code scanning / PSScriptAnalyzer

Line has trailing whitespace Note

Line has trailing whitespace
# Extract Id from URL
$Id = Get-SfObjectIdFromUrl -SfUrl $SfUrl
$type = Get-SfObjectTypeFromUrl -SfUrl $SfUrl

Check notice

Code scanning / PSScriptAnalyzer

Line has trailing whitespace Note

Line has trailing whitespace
# Extract Id from URL
$Id = Get-SfObjectIdFromUrl -SfUrl $SfUrl
$type = Get-SfObjectTypeFromUrl -SfUrl $SfUrl

Check notice

Code scanning / PSScriptAnalyzer

Line has trailing whitespace Note

Line has trailing whitespace
@rulasg rulasg merged commit bfb1fa1 into main Apr 21, 2025
3 checks passed
@rulasg rulasg deleted the getsf-with-id branch April 21, 2025 07:11
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.

1 participant