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, $ERP) { $name = $packageBase.replace('[ERP]', $ERP) return $name } |