< Back
ConvertTo-CsvObject
Post
NAME ConvertTo-CsvObject
SYNOPSIS
This function converts a CSV string to a CSV object.
SYNTAX
ConvertTo-CsvObject [-csvString] <String> [-trimHeaders] [[-convertIntegersMaxLength] <Int32>] [-convertBooleans]
[-trimStrings] [<CommonParameters>]
DESCRIPTION
This function takes in a CSV representation as a string and returns a custom object with
properties that correspond to the CSV.
PARAMETERS
-csvString <String>
The string containing the CSV representation.
Required? true
Position? 1
Default value
Accept pipeline input? false
Accept wildcard characters? false
-trimHeaders [<SwitchParameter>]
If this parameter is set, the names of the headers will be trimmed.
Required? false
Position? named
Default value [Switch]::Present
Accept pipeline input? false
Accept wildcard characters? false
-convertIntegersMaxLength <Int32>
If this parameter is set, strings consisting solely of digits with an optional '-' in front
which are shorter than the maximum length will be converted to integer variables.
Required? false
Position? 2
Default value 0
Accept pipeline input? false
Accept wildcard characters? false
-convertBooleans [<SwitchParameter>]
Select if strings "true" and "false" are processed into boolean $true and $false
Required? false
Position? named
Default value [Switch]::Present
Accept pipeline input? false
Accept wildcard characters? false
-trimStrings [<SwitchParameter>]
Select if strings should be trimmed of starting and trailing whitespace.
Required? false
Position? named
Default value False
Accept pipeline input? false
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
OUTPUTS
System.Object[]
RELATED LINKS
SYNOPSIS
This function converts a CSV string to a CSV object.
SYNTAX
ConvertTo-CsvObject [-csvString] <String> [-trimHeaders] [[-convertIntegersMaxLength] <Int32>] [-convertBooleans]
[-trimStrings] [<CommonParameters>]
DESCRIPTION
This function takes in a CSV representation as a string and returns a custom object with
properties that correspond to the CSV.
PARAMETERS
-csvString <String>
The string containing the CSV representation.
Required? true
Position? 1
Default value
Accept pipeline input? false
Accept wildcard characters? false
-trimHeaders [<SwitchParameter>]
If this parameter is set, the names of the headers will be trimmed.
Required? false
Position? named
Default value [Switch]::Present
Accept pipeline input? false
Accept wildcard characters? false
-convertIntegersMaxLength <Int32>
If this parameter is set, strings consisting solely of digits with an optional '-' in front
which are shorter than the maximum length will be converted to integer variables.
Required? false
Position? 2
Default value 0
Accept pipeline input? false
Accept wildcard characters? false
-convertBooleans [<SwitchParameter>]
Select if strings "true" and "false" are processed into boolean $true and $false
Required? false
Position? named
Default value [Switch]::Present
Accept pipeline input? false
Accept wildcard characters? false
-trimStrings [<SwitchParameter>]
Select if strings should be trimmed of starting and trailing whitespace.
Required? false
Position? named
Default value False
Accept pipeline input? false
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
OUTPUTS
System.Object[]
RELATED LINKS