Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move DBnull scrubbing from C# type to PoweShell #25

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

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