-
-
Notifications
You must be signed in to change notification settings - Fork 0
Update Get-SfAccount and Get-SfOpportunity functions with ID support and add URL ID extraction #22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| function Test_sfIdFromUrl{ | ||
|
|
||
| $urlList = @( | ||
| "https://github.lightning.force.com/lightning/r/Account/0010V00002Q8r78QAB/view", | ||
| "https://github.lightning.force.com/lightning/r/Account/0010V00002Q8r78QAB/", | ||
| "https://github.lightning.force.com/lightning/r/Account/0010V00002Q8r78QAB", | ||
| "https://github.my.salesforce.com/0010V00002Q8r78QAB" | ||
| ) | ||
|
|
||
| $urlList | ForEach-Object { | ||
| $result = Get-SfIdFromUrl $_ | ||
| Assert-AreEqual -Expected "0010V00002Q8r78QAB" -Presented $result.SfId | ||
| } | ||
|
|
||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| # PowerShell module to get the ID from a Service Fabric URL | ||
| # Allow to integrate with ProjectHelper returning SfId | ||
|
|
||
| function Get-SfIdFromUrl{ | ||
| [CmdletBinding()] | ||
| param( | ||
| [Parameter(Mandatory,ValueFromPipeline, Position=0)] | ||
| [string]$SfUrl | ||
| ) | ||
|
|
||
| process{ | ||
|
|
||
| # Extract Id from URL | ||
| $Id = Get-SfObjectIdFromUrl -SfUrl $SfUrl | ||
|
|
||
Check noticeCode scanning / PSScriptAnalyzer Line has trailing whitespace Note
Line has trailing whitespace
|
||
| $ret = @{ | ||
| SfId = $Id | ||
| } | ||
|
|
||
Check noticeCode scanning / PSScriptAnalyzer Line has trailing whitespace Note
Line has trailing whitespace
|
||
| return $ret | ||
Check noticeCode 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.
|
||
| } | ||
| } Export-ModuleMember -Function Get-SfIdFromUrl | ||
Check notice
Code scanning / PSScriptAnalyzer
The cmdlet 'Get-SfIdFromUrl' does not have a help comment. Note