AndrewRathbun / KAPE-EZToolsAncillaryUpdater

A script that updates KAPE (using Get-KAPEUpdate.ps1) as well as EZ Tools (within .\KAPE\Modules\bin) and the ancillary files that enhance the output of those tools
MIT License
53 stars 5 forks source link

Changes to the net6 copy function as discussed in #2 #7

Closed Donovoi closed 2 years ago

Donovoi commented 2 years ago

Hi Andrew.

I completed adding the changes. I'll first check if the Get-ZimmermanTools has created the net6 folder, if not it means that there are not any new tools to download so we can continue.

If the folder is created, we will go through the array for files in subfolders and copy them, we will then go through the rest of the tools and copy them.

I've hardcoded the names of the tools and their respective files. We could do a glob pattern search and copy everything that is an exe/dll/json file instead, which would allow us to add more tools without needing to change the code. Let me know if you would prefer to do that.

I've never done a proper pull request before so if there is something missing, please let me know.

Also, I have not done much formatting or tried to copy your formatting; I've just formatted it via vscode automatically.

I also got rid of some of the "&" as you (unless I'm not understanding something) do not need to invoke a function call as PowerShell will do that is you just put the name of the function.

Lastly I would like to update the log function to have some colour - red for error - yellow (or something similar) for warning - Green (or something similar) for normal output.

Let me know what you think.

AndrewRathbun commented 2 years ago

Yes, let's do the globbing for exe/json/dll. Great suggestion!

AndrewRathbun commented 2 years ago

In terms of formatting, regardless of what you do, I'm going to format in PowerShell Studio so a few of these might be undone but that's not end of the world.

I'll sign again once changes are complete to everyone's liking.

AndrewRathbun commented 2 years ago

In regards to the &, my understanding is it would ensure the lines of code weren't called until the previous one was complete, which typing that out I guess it would do that anyways haha.

I think best practice will be to include a couple seconds of sleep after a couple of these just to add some buffer between functions. I know especially with the PS copy/move functions sometimes that would bleed over into the next called function and it would create a wall of errors, so that's the main goal is to avoid that.

AndrewRathbun commented 2 years ago

@Donovoi for future reference, always make sure you fetch upstream prior to doing a PR

image

Here's a walkthrough of that

GitHubFetchandMergeandContributeExample