Skip to content
Snippets Groups Projects
Commit 4c565f80 authored by Niko Ehrenfeuchter's avatar Niko Ehrenfeuchter :keyboard:
Browse files

Add Find-InstallationPackage function.

Refers to #28
parent da20130c
Branches
Tags
No related merge requests found
...@@ -336,6 +336,23 @@ function NewConfig-IsValid { ...@@ -336,6 +336,23 @@ function NewConfig-IsValid {
} }
function Find-InstallationPackage {
Write-Verbose "Looking for installation package using pattern: $($Pattern)"
$PkgDir = Get-ChildItem -Path $UpdPathBinaries -Directory -Name |
Where-Object {$_ -match $Pattern} |
Sort-Object |
Select-Object -Last 1
if ([string]::IsNullOrEmpty($PkgDir)) {
Log-Error "couldn't find installation package matching '$($Pattern)'!"
Exit
}
$PkgDir = "$($UpdPathBinaries)\$($PkgDir)"
Write-Verbose "Found update installation package: [$($PkgDir)]"
Return $PkgDir
}
function Copy-ServiceFiles { function Copy-ServiceFiles {
try { try {
Write-Verbose "Looking for source package using pattern: $($Pattern)" Write-Verbose "Looking for source package using pattern: $($Pattern)"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment