forked from norman/fusionpbx-install.sh-github-mirror
Update the Windows install.
This commit is contained in:
17
windows/resources/expand-zip.ps1
Normal file
17
windows/resources/expand-zip.ps1
Normal file
@@ -0,0 +1,17 @@
|
||||
Function Expand-ZIP([string]$filename) {
|
||||
#Extract archive
|
||||
if ($PSVersionTable.PSVersion.Major -ge 5) {
|
||||
Expand-Archive $filename -DestinationPath .
|
||||
}
|
||||
elseif ( [System.Reflection.Assembly]::LoadWithPartialName("System.IO.Compression.FileSystem") ) {
|
||||
$path = Get-Location
|
||||
[System.IO.Compression.ZipFile]::ExtractToDirectory("$path\$filename",$path)
|
||||
}
|
||||
else {
|
||||
#Check if 7zip is installed and install it if needed
|
||||
. .\resources\install-7zip.ps1
|
||||
Install-7zip
|
||||
#Extract all files
|
||||
Start-Process "c:\Program Files\7-Zip\7z.exe" "e -y $filename"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user