I have followed instructions to install Tridion Powershell modules as per this post: How do I configure or set up the tridion-powershell-modules in PowerShell?.
I have set the Execution Policy to Unrestricted
and set the Tridion version to "2011-SP1"
Set-TridionCoreServiceSettings -version "2011-SP1"
When I try to run Get-TridionItem "tcm:4-2151"
I get the following error:
> You cannot call a method on a null-valued expression. At C:\Users\Administrator\Documents\WindowsPowerShell\Modules\Tridion-CoreService\Items.psm1:130 char:26
+ $client.Close <<<< () | Out-Null;
+ CategoryInfo : InvalidOperation: (Close:String) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : InvokeMethodOnNull
Here is a screenshot:
Here are my Tridion settings:
PS C:\Users\Administrator> Get-TridionCoreServiceSettings
ModuleVersion : 1.2.0.0
Version : 2011-SP1
UserName : TRIDION\Administrator
AssemblyPath : C:\Users\Administrator\Documents\WindowsPowerShell\Modules\Tridion-CoreService\Clients\Tridion.Content
Manager.CoreService.Client.2011sp1.dll
ClassName : Tridion.ContentManager.CoreService.Client.SessionAwareCoreServiceClient
ConnectionType : Default
HostName : localhost
EndpointUrl : http://localhost/webservices/CoreService2011.svc/wsHttp
What is the cause of the problem and how do I resolve it?
-- UPDATE --
I've gotten the latest code as per @Peter's comment and now receive a clear error message:
PS C:\Users\Administrator> Get-TridionItem "tcm:4-2151-16"
Get-TridionCoreServiceClient : There was no endpoint listening at http://localhost/webservices/CoreService2011.svc/wsHt tp that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if p resent, for more details. At C:\Users\Administrator\Documents\WindowsPowerShell\Modules\Tridion-CoreService\Items.psm1:116 char:41
+ $client = Get-TridionCoreServiceClient <<<< ;
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Get-TridionCoreServiceClient