HelperFunctions.ps1
function Get-TempDir { [System.IO.Path]::GetTempPath() } function tempFileName { Join-Path ([System.IO.Path]::GetTempPath()) "$([Guid]::newguid().ToString()).zip" } filter splitToArray($separator = ',') { $_.Split($separator).Trim() } filter findAppByNameInFolder($appBasePath) { Get-ChildItem -Path (Join-Path $appBasePath ("*_"+$_+"_*.app")) } <# TODO: Filter-AppsByName = splitToArray(',') | findAppByNameInFolder($appBasePath) Param ( [Parameter(Mandatory=$true)] [string] $appPath, [Parameter(Mandatory=$true)] [string] $appNames = "*" ) $appPaths = @($appNames.Split(',').Trim() | Foreach-Object { (Get-ChildItem -Path (Join-Path $appPath ("*_"+$_+"_*.app"))) } ) return $appPaths #> |