Link to home
Create AccountLog in
Avatar of davesnb
davesnbFlag for Canada

asked on

new-object -comobject

Hello EE,

I had a script runing under 2003 server and  powershell using the below com object , however when i run the getstatistics nothing comes back , the object is registered and the Egilh.ComTracker shows in the com object list . Is there a way to get this working under the 2012 64bit whcih I am running now?

$tracker = new-object -comobject Egilh.ComTracker
$trackerlist = [xml]($tracker.getstatistics())

Open in new window



 Get-ChildItem HKLM:\Software\Classes -ErrorAction SilentlyContinue | Where-Object {
   $_.PSChildName -match '^\w+\.\w+$' -and (Test-Path -Path "$($_.PSPath)\CLSID")
} | Select-Object -ExpandProperty PSChildName

Open in new window

Avatar of Qlemo
Qlemo
Flag of Germany image

Do you get anything?
new-object -comobject Egilh.ComTracker | gm

Open in new window

Avatar of davesnb

ASKER

No, that was my first line of code  . Blank result
SOLUTION
Avatar of Qlemo
Qlemo
Flag of Germany image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of davesnb

ASKER

OK It works when I run the 32 bit powershell version . However, in my case I have a script that runs on a powershell ssh session , so I need to force the script to run as 32bit . Is there a way to include something at the beginning of the script to run using 32bit powershell?
How do you connect exactly? When creating a remote PS session via WinRM you can provide a session configuration created for that purpose of making sure you run on 32bit.
Avatar of davesnb

ASKER

I connect using "powershell server " it runs as a service . So when I connect , it connects to the native shell, which in this case is 64 bit .
ASKER CERTIFIED SOLUTION
Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account