I have a Project Server instance created and I can access it via http://servername/pwa.
I have Alternate Access Mapping configured so I can also access it via http://servername.somedomain.com/pwa
All works fine from the browser.
However, I have custom C# code which makes a PowerShell call to Get-SPProjectWebInstance. It works fine if I use just the http://servername/pwa url to access, however it fails when using the http://servername.somedomain.com/pwa.
This is also reproducible from the command line as well.
I'm hoping I have missed a configuration step since changing the code isn't an option at this point.
Is it possible to configure the server so that Get-SPProjectWebInstance will work with multiple alternate access mapped urls?