Using EM to Proxy iControl

I have the following snippet of code:

foreach ($f5ip in $f5session.ManagementEM.get_devices())

{

Write-Host $f5ip;

$f5session.ConnectionInfo.setEndpoint($f5ip, 443, “/iControl/iControlPortal.cgi?context_id=” + $f5session.ManagementEM.get_context_id());

Write-Host $f5session.ManagementEM.set_device_context($f5ip);

Write-Host $f5session.SystemSystemInfo.get_version();

}

Now, there are 2 devices returned… one is the EM (127.0.0.1) and the other is a BIG-IP (192.168.56.2). However, running the PowerShell script, I get the following output:

127.0.0.1

EM_v3.1.1

192.168.56.2

EM_v3.1.1

I have tried a few different things, and am quite at a loss. Using the latest version of F5 EM. The Proxy iControl option is enabled on the EM.

Any ideas?