Create a powershell script to install a usb driver

Novas Nov 60 Reputation points
2024-02-21T22:30:41.75+00:00

Hi there, I want to install a driver update by GPO, I didn't find an msi but only an .exe. I've written a first part to install the file, but I'd like to do a test to prevent the .exe file from being reinstalled each time I start up. When I do a get-package, it appears in the list but is not recognized as an application when I do a get-package -Name Controller USb Ethernet. I need some advice please. For example, I tried : if(Get-Package -Name "Control USB GBE Realtek"){ Write-Output "Control USB GBE Realtek software is present on the machine!" } but the command Get-Package -Name "Control USB GBE Realtek" doesn't work. I need a little help please.

Windows for business | Windows Server | User experience | PowerShell
Windows for business | Windows Server | User experience | Other
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Anonymous
    2024-02-22T04:33:29.5733333+00:00

    Hi Novas Nov,

    You may consider creating a scheduled task to run the script in your GPO. Set the task trigger to run only once or select the "Apply once and do not reapply" option in the Common tab.

    Best Regards,

    Ian Xue


    If the Answer is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

  2. Novas Nov 60 Reputation points
    2024-02-22T08:43:47.1566667+00:00

    How can I do it? Do you have an example please ?

    0 comments No comments

  3. Anonymous
    2024-02-23T07:01:20.2066667+00:00

    Hi Novas Nov,

    Yuu can create a scheduled task under Computer Configuration > Preference > Control Panel Settings > Scheduled Tasks. User's image

    User's image

    User's image

    Best Regards,

    Ian Xue


    If the Answer is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.