Private/FileUtil.ps1
# Unzip file function Expand-ZIPFile($file, $destination) { $shell = new-object -com shell.application $zip = $shell.NameSpace($file) foreach($item in $zip.items()) { $shell.Namespace($destination).copyhere($item) } } function Get-PackageFolder($packageName) { $packageSrc = (Get-Package $packageName).Source $position = $PackageSrc.LastIndexOf("\") return $packageSrc.Substring(0, $position) } function Get-PackageFolderForVersion($packageName, $packageVersion) { $packageSrc = (Get-Package -Name $packageName -RequiredVersion $packageVersion).Source $position = $PackageSrc.LastIndexOf("\") return $packageSrc.Substring(0, $position) } function Get-PackageName($packageBase, $Adapter) { $name = $packageBase.replace('[Adapter]', $Adapter) return $name } function Get-version($packageBase, $Version) { $name = $packageBase.replace('[Version]', $Version) return $name } |