Skip to content

Commit

Permalink
Cleanup of 'New-DatumFileProvider' and aligned parameter name in 'Fil…
Browse files Browse the repository at this point in the history
…eProvider'
  • Loading branch information
raandree authored and gaelcolas committed Apr 7, 2021
1 parent 5e7126f commit bd7c0b8
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
are included in an array.
- Formatting in all files with VSCode formatting according to the 'settings.json' file taken from Sampler
- Added yaml format config settings 'singleQuote' and 'bracketSpacing' and reformatted all yaml files according to the new settings.
- Cleanup
- New-DatumFileProvider.ps1

## [0.0.39] - 2020-09-29

Expand Down
2 changes: 1 addition & 1 deletion source/Classes/FileProvider.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Class FileProvider : DatumProvider
$Result = Get-ChildItem $path | ForEach-Object {
if ($_.PSisContainer)
{
$val = [scriptblock]::Create("New-DatumFileProvider -Path `"$($_.FullName)`" -StoreOptions `$this.DataOptions -DatumHierarchyDefinition `$this.DatumHierarchyDefinition -Encoding `$this.Encoding")
$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
}
else
Expand Down
15 changes: 11 additions & 4 deletions source/Public/New-DatumFileProvider.ps1
Original file line number Diff line number Diff line change
@@ -1,22 +1,29 @@
function New-DatumFileProvider
{
Param(

[alias('DataOptions')]
[CmdletBinding()]
param (
[Parameter()]
[Alias('DataOptions')]
[AllowNull()]
[object]
$Store,

[Parameter()]
[AllowNull()]
[hashtable]
$DatumHierarchyDefinition = @{},

[Parameter()]
[string]
$Path = $Store.StoreOptions.Path,

[Parameter()]
[ValidateSet('Ascii', 'BigEndianUnicode', 'Default', 'Unicode', 'UTF32', 'UTF7', 'UTF8')]
[string]
$Encoding = 'Default'
)

if (!$DatumHierarchyDefinition)
if (-not $DatumHierarchyDefinition)
{
$DatumHierarchyDefinition = @{}
}
Expand Down

0 comments on commit bd7c0b8

Please sign in to comment.