From d4823b04907ec5be8fbe1c1e45528800b58b5ddd Mon Sep 17 00:00:00 2001 From: David Gardiner Date: Sun, 31 Mar 2024 12:32:12 +1030 Subject: [PATCH] Add Files property to AUPackage Fixes #52 --- src/Private/AUPackage.ps1 | 1 + src/Public/Update-Package.ps1 | 3 +++ 2 files changed, 4 insertions(+) diff --git a/src/Private/AUPackage.ps1 b/src/Private/AUPackage.ps1 index 36bc7b0b..782bac0a 100644 --- a/src/Private/AUPackage.ps1 +++ b/src/Private/AUPackage.ps1 @@ -13,6 +13,7 @@ class AUPackage { [string] $IgnoreMessage [string] $StreamsPath [System.Collections.Specialized.OrderedDictionary] $Streams + [string[]] $Files AUPackage([string] $Path ){ if ([String]::IsNullOrWhiteSpace( $Path )) { throw 'Package path can not be empty' } diff --git a/src/Public/Update-Package.ps1 b/src/Public/Update-Package.ps1 index bbc9867e..5db360d1 100644 --- a/src/Public/Update-Package.ps1 +++ b/src/Public/Update-Package.ps1 @@ -139,6 +139,9 @@ function Update-Package { if (!(Test-Path $filePath)) { throw "Can't find file path to checksum" } $item = Get-Item $filePath + + $package.Files += $item.FullName + $type = if ($global:Latest.ContainsKey('ChecksumType' + $a)) { $global:Latest.Item('ChecksumType' + $a) } else { 'sha256' } $hash = (Get-FileHash $item -Algorithm $type | ForEach-Object Hash).ToLowerInvariant()