diff --git a/CHANGELOG.md b/CHANGELOG.md index df2b704..6b40e1f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed -- Fixed `ConvertTo-Datum` always returns `$null` when DatumHandler returns `$false` (#139) +- Fixed `ConvertTo-Datum` always returns `$null` when DatumHandler returns `$false` (#139). +- Datum will throw errors when loading the data by moving from script properties to note properties (#143). ## [0.40.1] - 2023-04-03 diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 938655c..2423164 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -20,7 +20,7 @@ stages: vmImage: 'ubuntu-latest' steps: - pwsh: | - dotnet tool install --global GitVersion.Tool + dotnet tool install --global GitVersion.Tool --version 5.* $gitVersionObject = dotnet-gitversion | ConvertFrom-Json $gitVersionObject.PSObject.Properties.ForEach{ Write-Host -Object "Setting Task Variable '$($_.Name)' with value '$($_.Value)'." diff --git a/source/Classes/FileProvider.ps1 b/source/Classes/FileProvider.ps1 index 9fa4f2b..ad1d0ef 100644 --- a/source/Classes/FileProvider.ps1 +++ b/source/Classes/FileProvider.ps1 @@ -16,16 +16,16 @@ class FileProvider : DatumProvider $this.DatumHandlers = $DatumHierarchyDefinition.DatumHandlers $this.Encoding = $Encoding - $result = Get-ChildItem -Path $path | ForEach-Object { + $null = Get-ChildItem -Path $path | ForEach-Object { if ($_.PSIsContainer) { - $val = [scriptblock]::Create("New-DatumFileProvider -Path `"$($_.FullName)`" -Store `$this.DataOptions -DatumHierarchyDefinition `$this.DatumHierarchyDefinition -Encoding `$this.Encoding") - $this | Add-Member -MemberType ScriptProperty -Name $_.BaseName -Value $val + $val = New-DatumFileProvider -Path $_.FullName -Store $this.DataOptions -DatumHierarchyDefinition $this.DatumHierarchyDefinition -Encoding $this.Encoding + $this | Add-Member -MemberType NoteProperty -Name $_.BaseName -Value $val } else { - $val = [scriptblock]::Create("Get-FileProviderData -Path `"$($_.FullName)`" -DatumHandlers `$this.DatumHandlers -Encoding `$this.Encoding") - $this | Add-Member -MemberType ScriptProperty -Name $_.BaseName -Value $val + $val = Get-FileProviderData -Path $_.FullName -DatumHandlers $this.DatumHandlers -Encoding $this.Encoding + $this | Add-Member -MemberType NoteProperty -Name $_.BaseName -Value $val } } }