i have currently an issue with a powershell script i have developed. The following script runs on my system and on another developer machine but not on any other system... I have tested it on a virtual Win10 hyper v but it's always the same error:
Exception calling "ReadLookupTables" with "0" argument(s): "Object reference not set to an instance of an object.
The script code:
$pwaUrl = "https://xyz.co"
$userName = "xyz"
$password = "xyz"
Import-Module "$PSScriptRoot\ProjectHelper\Microsoft.ProjectServer.dll"
$projHelper = New-Object Microsoft.ProjectServer.MsProject($pwaUrl, $username, $password, $true)
$secSvc = $projHelper.GetSecuritySvc();
$secGroups = $secSvc.readGroupList();
$secGroups
On the developer machines Visual Studio Enterprise is installed... I have added all the SDK's and .Net Runtime environments on my virtual machine but it does not work.
Thanks for help