diff options
| author | Alexander Karatarakis <alkarata@microsoft.com> | 2017-10-17 13:19:42 -0700 |
|---|---|---|
| committer | Alexander Karatarakis <alkarata@microsoft.com> | 2017-10-17 13:23:22 -0700 |
| commit | 147cde8bfda4e7283e4d47cd8a55c5bd0c689081 (patch) | |
| tree | e2a3a3c43887ce84acd2b0ca7d4bf1ff8719eb01 /scripts/fetchDependency.ps1 | |
| parent | edb718e21b56ab62a6544a26c1bba450d952b32d (diff) | |
| download | vcpkg-147cde8bfda4e7283e4d47cd8a55c5bd0c689081.tar.gz vcpkg-147cde8bfda4e7283e4d47cd8a55c5bd0c689081.zip | |
[fetchDependency] Use Expand-Archive if it exists, otherwise fallback to cmd
Diffstat (limited to 'scripts/fetchDependency.ps1')
| -rw-r--r-- | scripts/fetchDependency.ps1 | 17 |
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 + } } } |
