aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/fetchDependency.ps117
1 files changed, 12 insertions, 5 deletions
diff --git a/scripts/fetchDependency.ps1 b/scripts/fetchDependency.ps1
index ac4ab5f46..6024895ae 100644
--- a/scripts/fetchDependency.ps1
+++ b/scripts/fetchDependency.ps1
@@ -101,12 +101,19 @@ function SelectProgram([Parameter(Mandatory=$true)][string]$Dependency)
New-Item -ItemType Directory -Path $destination | Out-Null
}
- $shell = new-object -com shell.application
- $zip = $shell.NameSpace($file)
- foreach($item in $zip.items())
+ if (Test-Command -commandName 'Expand-Archive')
{
- # Piping to Out-Null is used to block until finished
- $shell.Namespace($destination).copyhere($item) | Out-Null
+ Expand-Archive -path $file -destinationpath $destination
+ }
+ else
+ {
+ $shell = new-object -com shell.application
+ $zip = $shell.NameSpace($file)
+ foreach($item in $zip.items())
+ {
+ # Piping to Out-Null is used to block until finished
+ $shell.Namespace($destination).copyhere($item) | Out-Null
+ }
}
}