After installation from a script information are not update

Hello,

I’m new in powershell but i do a script that install my software to this point everything is okay, but after the install is the same script in try to get de file version i get the old version, but if i rerun my script information are update.
How can I fix this
exemple :

when i run this command i get the Bluetooth driver version installed :
gwmi win32_PnpSignedDriver | where{$_.Description -like “Wireless Bluetooth”}| Select Description

I install the lastest version

                Start-Process -FilePath ".\Intel_BT_22_90.exe" -ArgumentList $Arguments -Wait -WindowStyle Hidden

when i run this command after the install get the same Bluetooth driver befor install, I open another consol and do the same command information are update :
gwmi win32_PnpSignedDriver | where{$_.Description -like “Wireless Bluetooth”}| Select Description

Can anyone help i m stuck, i don’ know what looking

I search for profile reset, relunch powershell console inside the script but i stuck

Thanks for you help

Hi, welcome to the forum :wave:

First, when posting commands or scripts, please make sure to use the Preformatted text button </> so that they’re correctly formatted. Not only does it make it easier to read, it makes it much easier for us to copy and paste your commands for testing.

As to your question, this seems to be a fairly common problem. One suggestion that seems to work is to restart the WinMgmt service.

Restart-Service -Force -Name winmgmt

Hi Matt,

Next time i will do the preformatted text button, thanks for the advice.

Thanks for the advice, but on question is that normal ? because evey time is happen and not for getwmi, but to get file info or registry… is there a way to have new information after updating file, registry or maybe i do something wrong?

Thanks

if you want i can share on of my script