Comments (8)
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.
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.
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.
@PrzemyslawKlys done: EvotecIT/PSSharedGoods#1
from pswinreporting.
Great. Merged but I guess you need to fix still commit on PSWinReporting?
from pswinreporting.
@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.
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.
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)
- Error - no events were found that match for version 1.8.1.3 HOT 1
- Error - no events were found that match for version 1.8.1.5 HOT 6
- Domain Controller requirements? HOT 1
- PSWinReportingV1 - Error if log path doesn't exists
- [-] Event Log Error on <server>: The RPC server is unavailable
- Unable to install onto AzureVM HOT 2
- report highlighting with ad in german language HOT 18
- missing username in AD UserLockout events HOT 9
- Event ID 4722 (enabled), 4725 (disabled), 4726 (deleted) are not visible in the output file HOT 1
- ADUserChangesDetailed Event ID 5139 reporting issues HOT 4
- NTLMv1 request
- Charts are broken after running Find-Events HOT 2
- Using Loghost / ForwardedEvents
- Report generation taking a long time anywhere from 6 hours plus. HOT 4
- Logo Setup
- MS SQL Output: Error occured (Send-SqlInsert) HOT 2
- Not sending to Teams HOT 9
- Type of table keys HOT 1
- v2 setup instructions? HOT 4
- Colors & Styles not working with accents and other non-ascii characters
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pswinreporting.