From a3641bf7fc34ec70ee3c4c1aa5e5739ef6c2bf01 Mon Sep 17 00:00:00 2001 From: rulasg Date: Tue, 12 Aug 2025 07:47:26 +0200 Subject: [PATCH 1/2] chore: update public/CsvColumList.ps1 --- public/CsvColumList.ps1 | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 public/CsvColumList.ps1 diff --git a/public/CsvColumList.ps1 b/public/CsvColumList.ps1 new file mode 100644 index 0000000..e303e82 --- /dev/null +++ b/public/CsvColumList.ps1 @@ -0,0 +1,24 @@ +<# +.SYNOPSIS +Returns a list of column names from a CSV file. + +.DESCRIPTION +This function reads a CSV file and returns a list of its column names. + +.PARAMETER FilePath +The path to the CSV file. + +.EXAMPLE +Get-CsvColumnList -FilePath "C:\path\to\file.csv" + +.NOTES +#> +function Get-CsvColumnList { + [CmdletBinding()] + param ( + [Parameter(Mandatory)][string]$Path + ) + + $csv = Import-Csv -Path $Path + $csv | Get-Member -MemberType NoteProperty | Select-Object -ExpandProperty Name +} Export-ModuleMember -Function Get-CsvColumnList \ No newline at end of file From b899b990c2c25b948902c434f606e69f747d70a5 Mon Sep 17 00:00:00 2001 From: rulasg Date: Tue, 12 Aug 2025 07:47:26 +0200 Subject: [PATCH 2/2] chore: update public/CsvKeyList.ps1 --- public/CsvKeyList.ps1 | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 public/CsvKeyList.ps1 diff --git a/public/CsvKeyList.ps1 b/public/CsvKeyList.ps1 new file mode 100644 index 0000000..2f98c63 --- /dev/null +++ b/public/CsvKeyList.ps1 @@ -0,0 +1,21 @@ +<# +.SYNOPSIS +Returns a list of key values derived from CSV data. + +.DESCRIPTION +This function reads a CSV file and returns a list of unique values from a specified key column. + +.EXAMPLE +Get-CsvKeyList -Path "C:\path\to\file.csv" -KeyColumn "Id" +#> +function Get-CsvKeyList { + [CmdletBinding()] + param ( + [Parameter(Mandatory=$true)][string]$Path, + [Parameter(Mandatory=$true)][string]$KeyColumn + ) + + $csv = Import-Csv -Path $Path + $csv | Select-Object -ExpandProperty $KeyColumn | Sort-Object -Unique + +} Export-ModuleMember -Function Get-CsvKeyList \ No newline at end of file