I am trying Andrey's way to create a Core Service client in Powershell and having this issue.
I recreate the example on my Windows 7 machine. So far I learned I have run PowerShell ISE as root and run the Set-ExecutionPolicy RemoteSigned to allow unsigned PowerShell stuff.
When I run the this
$config_path = "D:\SDL Tridion\Core Service PowerShell\Andrey\2011SP1\Tridion.ContentManager.CoreService.Client.dll.config"
copy "$config_path" "$pshome\powershell.exe.config" -Force
[appdomain]::CurrentDomain.SetData("APP_CONFIG_FILE", "$pshome\powershell.exe.config")
Add-Type -Path "D:\SDL Tridion\Core Service PowerShell\Andrey\2011SP1\Tridion.ContentManager.CoreService.Client.dll"
$client = New-Object Tridion.ContentManager.CoreService.Client.SessionAwareCoreServiceClient("wsHttp_2011")
I get this error.
New-Object : Exception calling ".ctor" with "1" argument(s): "Could not find endpoint element with name 'wsHttp_2011' and contract 'Tridion.ContentManager.CoreService.Client.ISessionAwareCoreSe
rvice' in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this name could be f
ound in the client element."
At D:\SDL Tridion\Tridion 2013 release\Source code\Core Service PowerShell\Andrey\example.ps1:7 char:25
+ $client = New-Object <<<< Tridion.ContentManager.CoreService.Client.SessionAwareCoreServiceClient("wsHttp_2011")
+ CategoryInfo : InvalidOperation: (:) [New-Object], MethodInvocationException
+ FullyQualifiedErrorId : ConstructorInvokedThrowException,Microsoft.PowerShell.Commands.NewObjectCommand
What is missing here? Do I need any other resources aside Tridion.ContentManager.CoreService.Client.dll.config and Tridion.ContentManager.CoreService.Client.dll?