Skip to content

Commit

Permalink
Adding Get-LaMetricTime -Package (Fixes #72)
Browse files Browse the repository at this point in the history
  • Loading branch information
StartAutomating authored and StartAutomating committed Nov 10, 2022
1 parent 9af8f0e commit 0567343
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions Functions/LaMetric/Get-LaMetricTime.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ function Get-LaMetricTime {
[Parameter(Mandatory,ParameterSetName='api/v2/device/apps')]
[Alias('App','Apps','Applications')]
[switch]
$Application
$Application,
[Parameter(Mandatory,ParameterSetName='api/v2/device/apps/$Package',ValueFromPipelineByPropertyName)]
[string]
$Package
)
begin {
if (-not $script:LaMetricTimeCache) {
Expand All @@ -33,6 +36,7 @@ function Get-LaMetricTime {
}
$friendlyParameterSetNames = @{
"api/v2/device/apps" = "Application"
'api/v2/device/apps/$packages' = "Application.Details"
}
$expandPropertiesIn = @("api/v2/device/apps")
}
Expand Down Expand Up @@ -60,7 +64,8 @@ function Get-LaMetricTime {
if ($PSCmdlet.ParameterSetName -like 'api*') {
foreach ($ip in $IPAddress) {
$ipAndPort = "${ipAddress}:8080"
$endpoint = $PSCmdlet.ParameterSetName -replace '^api'
$endpoint =
$ExecutionContext.SessionState.InvokeCommand.ExpandString($PSCmdlet.ParameterSetName) -replace '^api'
$typename =
if ($friendlyParameterSetNames[$PSCmdlet.ParameterSetName]) {
$friendlyParameterSetNames[$PSCmdlet.ParameterSetName]
Expand Down

0 comments on commit 0567343

Please sign in to comment.