Impor PowerShell File CSV
import-csv c:\users\[username]\Documents\MyImportFile.csv -delimiter ";"
Pheatus
import-csv c:\users\[username]\Documents\MyImportFile.csv -delimiter ";"
# CSV file format:
# Variable, Value, Filter
# var1, val1, env1
Write-Verbose "Importing CSV File with Variables for env $VarNameFilter : $CsvFileVar"
$csv = Import-Csv $CsvFileVar
$variables = @()
$csv | Where-Object { $_.Filter -eq $VarNameFilter -or $_.Filter -like $VarNameFilter } | ForEach-Object {
$variables += [pscustomobject]@{
Name = $_.Variable;
Value = $_.Value;
}
}