-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGet-DeliveryLink.ps1
More file actions
38 lines (34 loc) · 1.14 KB
/
Get-DeliveryLink.ps1
File metadata and controls
38 lines (34 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
function Get-DeliveryLink {
[CmdletBinding()]
Param (
[parameter(Mandatory = $false)]
[ValidateScript({ Test-ValidateId -id $_ })]
[int]$deliveryId
,
[parameter(Mandatory = $false)]
[ValidateScript({ Test-ValidateNo -no $_ })]
[int]$deliveryNo
,
[Parameter(Mandatory = $false)]
[string]$alias = 'lf'
)
begin {
Write-Verbose -Message ((Get-ResStr 'STARTING_FUNCTION') -f $myInvocation.Mycommand)
Test-ValidateSingle -validParams (Get-SingleDeliveryKeys) @PSBoundParameters
New-Variable -Name 'result' -Scope 'Private' -Value ([string]'')
$initialVariables = Get-CurrentVariables -Debug:$DebugPreference
}
process {
if ($alias) { $alias = "$alias." }
if ($deliveryId) {
[string]$result = "$($alias)Id = $deliveryId"
} else {
[string]$result = "$($alias)KopfNummer = $deliveryNo"
}
}
end {
Get-CurrentVariables -InitialVariables $initialVariables -Debug:$DebugPreference
Return $result
}
# Test: Get-DeliveryLink -deliveryId 28096 -alias lf
}