aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorAlexander Karatarakis <alkarata@microsoft.com>2017-10-17 13:19:42 -0700
committerAlexander Karatarakis <alkarata@microsoft.com>2017-10-17 13:23:22 -0700
commit147cde8bfda4e7283e4d47cd8a55c5bd0c689081 (patch)
treee2a3a3c43887ce84acd2b0ca7d4bf1ff8719eb01 /scripts
parentedb718e21b56ab62a6544a26c1bba450d952b32d (diff)
downloadvcpkg-147cde8bfda4e7283e4d47cd8a55c5bd0c689081.tar.gz
vcpkg-147cde8bfda4e7283e4d47cd8a55c5bd0c689081.zip
[fetchDependency] Use Expand-Archive if it exists, otherwise fallback to cmd
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
+ }
}
}