< Back

Invoke-ColumnMapper

Mon Jan 13, 2020 4:02 am

NAME Invoke-ColumnMapper



SYNOPSIS

Consolidate duplicate row values and create new columns for each unique value found in a corresponding column.





SYNTAX

Invoke-ColumnMapper [-InputPath] <Object> [[-KeysHeader] <String>] [[-OutputPath] <String>] [[-ValuesHeader]

<String>] [-NoExport] [-Open] [<CommonParameters>]





DESCRIPTION

ColumnMapper finds all unique values in the column specified by the KeysHeader parameter and converts them to hash

keys. When it finds a new key,

it asks for any values found in the column specified by the ValuesHeader parameter and adds them to a new array.

It continues to add any new values

found in the ValuesHeader column to each corresponding array. Finally, we split the array into a comma-separated

string so that it can be imported

easily into your favorite spreadsheet application.





PARAMETERS

-InputPath <Object>

The absolute or relative path to the input CSV file.



Required? true

Position? 1

Default value

Accept pipeline input? false

Accept wildcard characters? false



-KeysHeader <String>

Specifies the column name to search in for the row identifiers. ColumnMapper will use these values as the

primary row identifiers. Currently defaults to '[PO] Order Id' for legacy purposes.



Required? false

Position? 2

Default value [PO] Order Id

Accept pipeline input? false

Accept wildcard characters? false



-OutputPath <String>

Specifies the path to write the output CSV file to. Defaults to ColumnMap_YYYYMMDD.csv



Required? false

Position? 3

Default value "ColumnMap_$(Get-Date -UFormat "%Y%m%d").csv"

Accept pipeline input? false

Accept wildcard characters? false



-ValuesHeader <String>

Specifies the column name to search for unique values mapped to the row identifiers. ColumnMapper will take

any value found in the first column and create new columns for each unique value found in this one. Currently

defaults to '[PO]GL Account (GL Account Id)' for legacy purposes.



Required? false

Position? 4

Default value [PO]GL Account (GL Account Id)

Accept pipeline input? false

Accept wildcard characters? false



-NoExport [<SwitchParameter>]



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-Open [<SwitchParameter>]

Opens the output CSV file. Defaults to false.



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





RELATED LINKS