Skip to content

Commit

Permalink
Build script not working properly with PowerShell 7
Browse files Browse the repository at this point in the history
  • Loading branch information
JosefNemec committed Jan 21, 2020
1 parent a7fabbe commit 3b3f8eb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions build/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ function CreateDirectoryDiff()
[string]$OutPath
)

$baseDirFiles = Get-ChildItem $BaseDir -Recurse | ForEach { Get-FileHash -Path $_.FullName -Algorithm MD5 }
$targetDirFiles = Get-ChildItem $TargetDir -Recurse | ForEach { Get-FileHash -Path $_.FullName -Algorithm MD5 }
$baseDirFiles = Get-ChildItem $BaseDir -Recurse -File | ForEach { Get-FileHash -Path $_.FullName -Algorithm MD5 }
$targetDirFiles = Get-ChildItem $TargetDir -Recurse -File | ForEach { Get-FileHash -Path $_.FullName -Algorithm MD5 }
$diffs = Compare-Object -ReferenceObject $baseDirFiles -DifferenceObject $targetDirFiles -Property Hash -PassThru | Where { $_.SideIndicator -eq "=>" } | Select-Object Path
New-EmptyFolder $OutPath

Expand All @@ -110,7 +110,7 @@ function CreateDirectoryDiff()
New-EmptyFolder $tempPath
Copy-Item (Join-Path $BaseDir "*") $tempPath -Recurse -Force
Copy-Item (Join-Path $OutPath "*") $tempPath -Recurse -Force
$tempPathFiles = Get-ChildItem $tempPath -Recurse | ForEach { Get-FileHash -Path $_.FullName -Algorithm MD5 }
$tempPathFiles = Get-ChildItem $tempPath -Recurse -File | ForEach { Get-FileHash -Path $_.FullName -Algorithm MD5 }
$tempDiff = Compare-Object -ReferenceObject $targetDirFiles -DifferenceObject $tempPathFiles -Property Hash -PassThru

# Ignore removed files
Expand Down
2 changes: 1 addition & 1 deletion build/common.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ function global:SignFile()
{
Write-Host "Signing file `"$Path`"" -ForegroundColor Green
$signToolPath = (Resolve-Path "c:\Program Files*\Windows Kits\*\bin\*\x86\signtool.exe").Path
$res = StartAndWait $signToolPath ('sign /n "Open Source Developer, Josef Němec" /t http://time.certum.pl /v' + "`"$Path`"")
$res = StartAndWait $signToolPath ('sign /n "Open Source Developer, Josef Němec" /t http://time.certum.pl /v ' + "`"$Path`"")
if ($res -ne 0)
{
throw "Failed to sign file."
Expand Down

0 comments on commit 3b3f8eb

Please sign in to comment.