aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorAlexander Karatarakis <alkarata@microsoft.com>2018-03-27 03:04:05 -0700
committerAlexander Karatarakis <alkarata@microsoft.com>2018-03-27 03:04:05 -0700
commit72758773321476dcbb7b9d18f11bf57134bb4545 (patch)
tree63575a3fe5f2a615372a0903ddd2661f397555ac /scripts
parent64ab9dc274c352f9999f2cc4e8f7f6830cc56c42 (diff)
downloadvcpkg-72758773321476dcbb7b9d18f11bf57134bb4545.tar.gz
vcpkg-72758773321476dcbb7b9d18f11bf57134bb4545.zip
[ps1] Fixes/tweaks
Diffstat (limited to 'scripts')
-rw-r--r--scripts/VcpkgPowershellUtils.ps113
-rw-r--r--scripts/fetchTool.ps12
2 files changed, 7 insertions, 8 deletions
diff --git a/scripts/VcpkgPowershellUtils.ps1 b/scripts/VcpkgPowershellUtils.ps1
index d9c9e3760..bc84afa7f 100644
--- a/scripts/VcpkgPowershellUtils.ps1
+++ b/scripts/VcpkgPowershellUtils.ps1
@@ -110,9 +110,9 @@ function vcpkgGetSHA256([Parameter(Mandatory=$true)][string]$filePath)
function vcpkgCheckEqualFileHash( [Parameter(Mandatory=$true)][string]$filePath,
[Parameter(Mandatory=$true)][string]$expectedHash,
- [Parameter(Mandatory=$true)][string]$actualHash )
+ [Parameter(Mandatory=$true)][string]$actualHash)
{
- if ($expectedDownloadedFileHash -ne $downloadedFileHash)
+ if ($expectedHash -ne $actualHash)
{
Write-Host ("`nFile does not have expected hash:`n" +
" File path: [ $filePath ]`n" +
@@ -150,7 +150,6 @@ function vcpkgDownloadFile( [Parameter(Mandatory=$true)][string]$url,
$downloadPartPath = "$downloadPath.part"
vcpkgRemoveItem $downloadPartPath
-
$wc = New-Object System.Net.WebClient
if (!$wc.Proxy.IsBypassed($url))
{
@@ -161,7 +160,7 @@ function vcpkgDownloadFile( [Parameter(Mandatory=$true)][string]$url,
Move-Item -Path $downloadPartPath -Destination $downloadPath
}
-function vcpkgExtractFile( [Parameter(Mandatory=$true)][string]$file,
+function vcpkgExtractFile( [Parameter(Mandatory=$true)][string]$archivePath,
[Parameter(Mandatory=$true)][string]$destinationDir,
[Parameter(Mandatory=$true)][string]$outFilename)
{
@@ -176,18 +175,18 @@ function vcpkgExtractFile( [Parameter(Mandatory=$true)][string]$file,
if (vcpkgHasCommand -commandName 'Microsoft.PowerShell.Archive\Expand-Archive')
{
Write-Verbose("Extracting with Microsoft.PowerShell.Archive\Expand-Archive")
- Microsoft.PowerShell.Archive\Expand-Archive -path $file -destinationpath $destinationPartial
+ Microsoft.PowerShell.Archive\Expand-Archive -path $archivePath -destinationpath $destinationPartial
}
elseif (vcpkgHasCommand -commandName 'Pscx\Expand-Archive')
{
Write-Verbose("Extracting with Pscx\Expand-Archive")
- Pscx\Expand-Archive -path $file -OutputPath $destinationPartial
+ Pscx\Expand-Archive -path $archivePath -OutputPath $destinationPartial
}
else
{
Write-Verbose("Extracting via shell")
$shell = new-object -com shell.application
- $zip = $shell.NameSpace($(Get-Item $file).fullname)
+ $zip = $shell.NameSpace($(Get-Item $archivePath).fullname)
foreach($item in $zip.items())
{
# Piping to Out-Null is used to block until finished
diff --git a/scripts/fetchTool.ps1 b/scripts/fetchTool.ps1
index ff9b5d9bf..a52986553 100644
--- a/scripts/fetchTool.ps1
+++ b/scripts/fetchTool.ps1
@@ -47,7 +47,7 @@ function fetchToolInternal([Parameter(Mandatory=$true)][string]$tool)
{
Write-Host "Downloading $tool..."
vcpkgDownloadFile $url $downloadPath
- Write-Host "Downloading $tool has completed successfully."
+ Write-Host "Downloading $tool... done."
}
$expectedDownloadedFileHash = @($toolData.sha256)[0]