Hi Fred,
I need to convert parameters to a specific camelcase (for forwarding case insensitive function parameters to a case sensitive REST API).
Normally I use $PSBoundParameters | ConvertTo-PSFHashTable for generating the parameter variable, but with the case sensitivity it's not working.
# Example HashTable with missmatching case - API needs param lowercase
C:\> @{HubbA=123}|ConvertTo-Json -Compress
{"HubbA":123}
# Trying to use the remap param for it does not return a result at all
C:\> @{HubbA=123}|ConvertTo-PSFHashtable -Remap @{hubba='hubba'}|ConvertTo-Json -Compress
{}
# Adding CaseSenitive switch does generate a result, but the wrong one
C:\> @{HubbA=123}|ConvertTo-PSFHashtable -Remap @{hubba='hubba'} -CaseSensitive|ConvertTo-Json -Compress
{"HubbA":123}
# Doing it twice does the job but is ugly
C:\> @{HubbA=123}|ConvertTo-PSFHashtable -Remap @{hubba='bubba'}|ConvertTo-PSFHashtable -Remap @{bubba='hubba'}|ConvertTo-Json -Compress
{"hubba":123}
Hi Fred, I need to convert parameters to a specific camelcase (for forwarding case insensitive function parameters to a case sensitive REST API).
Normally I use
$PSBoundParameters | ConvertTo-PSFHashTable
for generating the parameter variable, but with the case sensitivity it's not working.Could such thing be added?