Functions/Private/GetResourcePlans.ps1
function GetResourcePlans { <# .SYNOPSIS Returns the contents of the Resources/Templates/TemplatePlans.csv. .EXAMPLE PS C:\> GetResourcePlans Returns the contents of the sample resource file. #> [CmdletBinding()] [OutputType([System.Collections.HashTable])] Param ( ) Process { $moduleRoot = $MyInvocation.MyCommand.Module.ModuleBase $filePath = Join-Path -Path $moduleRoot -ChildPath "Resources\Templates\TemplatePlans.csv" $fileContents = Get-Content -Path $filePath -Raw $plans = @{} $fileContents | ConvertFrom-Csv | ForEach-Object { $plans[$_.PRODUCT_ID] = $_.PRODUCT_NAME } return $plans } } |