GithubHelp home page GithubHelp logo

Comments (8)

PrzemyslawKlys avatar PrzemyslawKlys commented on May 9, 2024

Hi,

First of all - Always. Any PR's are allowed (for any projects I run) and even more are welcomed with open arms :-)

Now there is only few things I would like to keep:

  • Don't disable old feature but keep the old one and add some configuration for it (in "starting hashtable"). That way we cover old way and new way. There is a reason why I did this as your way is not always displaying correctly in some scenarios either. I'm happy to have a choice and to give a choice. Even thou I may not use this one, you will so it's great to have it.
  • For that new feature add configuration check (there is a function inside that requires hashtable key to exists). This makes sure that if user upgrades he gets terminated on checking the configuration and therefore he can go thru changes that were implemented to understand new features. I do this to not surprise users.

I would also need an explanation (it's a legit question that I would like to understand):

  • benefit $PSBoundParameters.ContainsKey vs $InlineAttachments -eq $nul ? I have seen this few times but have not bothered to go deep to find the reasoning for it over theway I use it.
  • what does alternateview gives?
  • what is the benefit of Get-ContentType inside a function? I do keep each function separate even thou it may be used only by Send-Email only. But maybe there is some performance impact? If no I would prefer to have it as a separate function one can use for other stuff if need arises.

Good enough?

from pswinreporting.

snd3r avatar snd3r commented on May 9, 2024

Don't disable old feature but keep the old one and add some configuration for it (in "starting hashtable"). That way we cover old way and new way.

Got it.

benefit $PSBoundParameters.ContainsKey vs $InlineAttachments -eq $nul ?

Benefit in explicit simplicity.
If we use $InlineAttachments -eq $null, we extend the scope to the whole script and may be affected by side effects. If we use $PSBoundParameters.ContainsKey, we reduce the scope, declare checking input parameters explicitly and we no longer need defaults args value.
Imo this code looks cleaner.

what is the benefit of Get-ContentType inside a function?

Benefit - decrease the scope, a decrease cognitive load. It seemed to me not right to tear this small helper function from the context, I do not think that it will be useful elsewhere.
If you think it's right to move it to separate file, let's do it. The number of mime types can be increased, maybe then its separation be more appropriate.

from pswinreporting.

PrzemyslawKlys avatar PrzemyslawKlys commented on May 9, 2024

Great. Thank you for explanations. Please extract function outside to Objects folder. I'm sure it will come in handy for something else ;-) I'm slowly building up PSSharedGoods to be my go to module for multiple functions. I also fix and clean them up when I have time as I know there are dragons there ;-)

Feel free to submit PR when ready ;-) And I'm very open to seeing more work from you!

from pswinreporting.

snd3r avatar snd3r commented on May 9, 2024

@PrzemyslawKlys done: EvotecIT/PSSharedGoods#1

from pswinreporting.

PrzemyslawKlys avatar PrzemyslawKlys commented on May 9, 2024

Great. Merged but I guess you need to fix still commit on PSWinReporting?

from pswinreporting.

snd3r avatar snd3r commented on May 9, 2024

@PrzemyslawKlys sorry, I do not understand what I need to do (fix). This is my first PR, if you tell me what to do, I will be very grateful!
What change do I need to add to this PR?
#10

from pswinreporting.

PrzemyslawKlys avatar PrzemyslawKlys commented on May 9, 2024

I think you fixed it now. Before you overwrote the height/width settings as those are not needed for inline I guess. It's still needed for standard insert if one wants to overwrite default size. Looks good to me now. I will merge this and do some tests later on for it. Then blog post + release. Version here vs version on the PowerShellGallery is a bit outdated. This one supports reading events from Files, Folders, DC's and Forwarders at same time. The old one doesn't do that.

Great PR btw!

from pswinreporting.

snd3r avatar snd3r commented on May 9, 2024

Got it =)
I checked it before shipping, overwrite default size with embedding works as it should.
Thanks, nice to work with you!

from pswinreporting.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.