ZenitH-AT / nvidia-update

Checks for a new version of the NVIDIA driver, downloads and installs it.
MIT License
56 stars 8 forks source link

Log file location and No User Intervention required for Automation #9

Closed Pkistampally closed 1 year ago

Pkistampally commented 1 year ago

Hello Robert, I have tested the previous modification for local file downloads for gpu-data.jason and OS-data.jason file and it worked perfectly fine... except few things below.
when I ran the script it is waiting for user input for example,, select YEs or NO for new Driver download and Presss any Key to exist the script after the completion... above are good when we do for Individual users and for checking to see where the script is stopping but it is not for bulk deployment where there shouldnt be any user intervention. also can you please add the logging in the script to a local file so that we can refer to that file once completed and see what exactly going on if there is an error..

kindly please add the above 3 when possible.. I have currently hashed the below lines from the code for mass deployment image image image

Pkistampally commented 1 year ago

image

Pkistampally commented 1 year ago

This could be an Enhancement but not a bug

ZenitH-AT commented 1 year ago

Yeah, running the script silently, using all the default options for any prompts, is one thing I have been thinking of adding for a while, which would make the scheduled task system a lot more useful.

Naturally, running the script silently would output everything to a timestamped text file in a configurable location.

I don't have much time to work on nvidia-update this month but it'll be the next thing I implement in the coming weeks.

Pkistampally commented 1 year ago

Thank you for the Update Robert. Appreciate your time in working on this for community like this. for now, as I shown above screen shorts, I have commented the code and ran through without any issues, but logging is the only thing missing. do you know what the other issues are I will have if I comment all those lines above which showed in my screen shot apart from script going in silent mode.

ZenitH-AT commented 1 year ago

There may actually be some issues. Commenting out the "press any key to exit" related code is fine but for the $decision = ... stuff, you should rather just change the value being assigned to the default values.

It shouldn't really matter since the logic is such that the default option isn't handled in if statements but it's best to actually have the $decision variable set rathern than comment it out, just in case.

Example:

$decision = $Host.UI.PromptForChoice("", "`nDo you want to download and install the latest driver?", $options, 0)

Changes to:

$decision = 0

Where 0 is the default option index (at the end of the original line). You'd basically just search for "$decision =" in the script and modify those lines accordingly to make the script run in a sort of silent mode.


When I get around to updating the script I'll have to move the PromptForChoice() related code to a separate function whose behaviour is based on whether the script is being run in silent mode.


For logging, I just need to redirect all output to a text file right before the script exits. The only issue I can think of is stuff like the loading wheel when the driver is being downloaded. I also want to standardise some of the output messages, since not every one writes a timestamp.

So it might be pretty simple to do a basic implementation but doing it the "right way" (if someone with my experience can even say that) may take some time.

ZenitH-AT commented 1 year ago

A new release will be ready this weekend, adding a -Silent and -LogFilePath optional parameters.

EDIT: I'll release it later today, still need to do some testing. Logs implementation isn't perfect but should suffice for now.

Pkistampally commented 1 year ago

Awesome, That’s really a great news. Thank you for doing this for the community.

Thank you, Pavan Kistampally

From: Robert Berge @.> Sent: Tuesday, January 31, 2023 9:49 PM To: ZenitH-AT/nvidia-update @.> Cc: Pavan Kistampally @.>; Author @.> Subject: Re: [ZenitH-AT/nvidia-update] Log file location and No User Intervention required for Automation (Issue #9)

A new release will be ready this weekend, adding a -Silent and -LogFilePath optional parameters.

— Reply to this email directly, view it on GitHubhttps://github.com/ZenitH-AT/nvidia-update/issues/9#issuecomment-1411501491, or unsubscribehttps://github.com/notifications/unsubscribe-auth/APFPGSJPPMILHLYOJCIG33LWVH2NFANCNFSM6AAAAAATRZT4RM. You are receiving this because you authored the thread.Message ID: @.**@.>>

CONFIDENTIAL AND PROPRIETARY

This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error, please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute, or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. If you are not the intended recipient you are notified that disclosing, copying, distributing, or taking any action in reliance on the contents of this information is strictly prohibited..

2023 © Accelitas.com https://www.Accelitas.com

ZenitH-AT commented 1 year ago

Fixed by https://github.com/ZenitH-AT/nvidia-update/commit/385e7be52232d2af239252d2d682d90ab0f71917; new release.

The logging implementation isn't fully comprehensive but can be improved in the future as needed.