Skip to content

Import-FromCsvSource

SYNOPSIS

Returns the objects described by the content in the CSV file.

SYNTAX

1
Import-FromCsvSource [-SourceSettings] <PSObject> [-ProgressAction <ActionPreference>] [<CommonParameters>]

DESCRIPTION

The Import-FromCsvSource is a wrapper for the Import-Csv cmdlet. It invokes the Import-Csv cmdlet with the parameters provided from the importclient configuration.

EXAMPLES

EXAMPLE 1

1
2
3
4
5
6
7
$sourceSettingsObject = [PSCustomObject]@{
    path = 'pathtodirectory'
    fileNameWithExtension = 'filewithdata.csv'
    separator = ';'
    charset = 'Windows-1252'
}
Import-FromCsvSource -SourceSettings $sourceSettingsObject

firstname lastname mail username --------- -------- ---- -------- test1 testsson1 test1@testsson.com tete1 test2 testsson2 test2@testsson.com tete2 test3 testsson3 test3@testsson.com tete3 test4 testsson4 test4@testsson.com tete4 test5 testsson5 test5@testsson.com tete5

PARAMETERS

-ProgressAction

Determines how PowerShell responds to progress updates generated by a script, cmdlet, or provider, such as the progress bars generated by the Write-Progress cmdlet. The Write-Progress cmdlet creates progress bars that show a command's status.

The ProgressAction parameter takes one of the ActionPreference enumeration values: SilentlyContinue, Stop, Continue, Inquire, Ignore, Suspend, or Break.

1
2
3
4
5
6
7
8
9
Type: ActionPreference
Parameter Sets: (All)
Aliases: proga

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-SourceSettings

Object with settings for how to read the content of the CSV file.

1
2
3
4
5
6
7
8
9
Type: PSObject
Parameter Sets: (All)
Aliases:

Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

PSCustomObject

OUTPUTS

Object

NOTES