In the first scriptlet you posted you have the following line:

 Code:
  ; Define the primary registry key  $RegKey = $Target + 'HKLM\SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002bE10318}'


which should be:
 Code:
  ; Define the primary registry key
  $RegKey = $Target + 'HKLM\SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002bE10318}'


See the crlf? Altered original udf code -> Fail ;\)
Additionally:
Your $Computer Variable is 'empty', thus useless. If you want to query Remote Systems, feed the udf with a Hostname, otherwise, for local queries, just omit the optional Value.

Hope this Helps
_________________________