To add to this, below are the group policy and registry locations to change this setting to do the same as the comment above in order to allow for automation. Of course with the disclaimer that you should only use these if you know what you are doing.
Group policy
Computer Configuration -> Administrative Templates -> System -> Device Installation -> Prevent automatic download of applications associated with device metadata. Set the policy to enabled.
Registry (also works on Home edition)
HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Device Metadata. Create a REG_DWORD within called PreventDeviceMetadataFromNetwork and set the value to 1.
To add to this, below are the group policy and registry locations to change this setting to do the same as the comment above in order to allow for automation. Of course with the disclaimer that you should only use these if you know what you are doing.
Group policy
Computer Configuration -> Administrative Templates -> System -> Device Installation -> Prevent automatic download of applications associated with device metadata. Set the policy to enabled.
Registry (also works on Home edition)
HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Device Metadata. Create a REG_DWORD within called PreventDeviceMetadataFromNetwork and set the value to 1.