Skip to content

Conversation

@jeremymcgee73
Copy link

I have moved from using a C# type to handle DBNulls to using PowerShell. I used the same logic as the C# function. I mainly did this because C# types do not work in AWS lambda functions. But, I believe it is more readable for PowerShell folks. I believe this also cleaned up the code.

@RamblingCookieMonster
Copy link
Collaborator

Hiyo!

I like the idea, particularly for environments that preclude using C# this way. That said, two suggestions!

  • It might be worth adding a new -As option. I'm bad at naming, but for example, PSObjectViaPS or some other variation. This way the function would continue behaving exactly as before, with flexibility for folks in more restricted environments
  • Look into optimizing your code as much as possible - given how often this code will run for certain returned data, any small differences can add up, quickly. If you kept the Add-Member methodology, for example, you could swap $PSObject | Add-Member -MemberType NoteProperty -Name $column.ColumnName -Value $value for Add-Member -InputObject $PSObject -MemberType NoteProperty -Name $column.ColumnName -Value $value to avoid the costs that come with pipeline use

Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants