0

We have been using our expanded version of the Tridion PowerShell API modules for many years. Recently I was forced to update to PowerShell 7 (from PS 5) because of a migration of SharePoint to SharePoint online. that's a long story... but, we manage some information (like lists of users requesting pre-production CME access) in SharePoint online and I need our script to read from SOL and then call the core service API accordingly. Now with PowerShell 7, when I try to establish my core service connection, I get failures. Specifically, when I call the below, it has no transaction properties.

   Get-TridionCoreServiceClient: The property 'transactionFlow' cannot be found on this object. Verify that the property exists and can be set.

so, inside the many layers, this is being executed:

$binding = New-Object System.ServiceModel.NetTcpBinding
$binding.transactionFlow = $true
$binding.transactionProtocol = [ServiceModel.TransactionProtocol]::OleTransactions
$binding.Security.Mode = [System.ServiceModel.SecurityMode]::Transport
$binding.Security.Transport.ClientCredentialType = "Windows"

so, there's something about nettcp binding different in PowerShell 7 my searching so far turned up this statement, which may give a clue, but not enough to help me find a solution:

It seems like you're encountering an issue with using System.ServiceModel.NetTcpBinding in PowerShell 7. This is likely due to the fact that WCF (Windows Communication Foundation) is not fully supported in .NET Core, which PowerShell 7 is built on. I have tried to change the connection to http(s) without success, but that's likely user error on my part. If anyone would have some suggestions/guidance on how to get this working, I'd greatly appreciate it.

2 Answers 2

1

Tridion-Coreservice Module will not work on PS7, that much is clear.

I have also had import/sync challenges where the source system required PS7, while Tridion-Coreservice needs PS5. My solution was to create multiple scripts: 1 script fetches the content from the source system, and exports to intermediate format (ExportTo-CSV, ExportTo-Json, Out-File). The other script imports than in Tridion after reading the source from disk.

Added benefits: the modular approach! (more granular control, easy retries)

0

Indeed, PowerShell 7 uses .NET Core, which has limited support for WCF. Recent versions of .NET Core (simply called .NET 8.0) should have support for WCF clients, but even that is not 100%.

So, I think that trying to run the Tridion PowerShell module on PowerShell 7 may be a bit too ambitious. You should run it on Windows PowerShell 5.1 (the latest version of PowerShell which is based on .NET Framework), which is part of Windows. Note that PowerShell 7 does not replace Windows PowerShell 5.1; they can run side-by-side.

2
  • i realize I can (and do) run PS5 and PS7 independently. but. my requirement is to read from SOL (requires PS7) and "write" to Tridion via API (requires PS5). so... I'm stuck in a bad situation. I really need to find a way to get the core service API working here in PS5 Commented Nov 14 at 16:07
  • Which version of Tridion Sites are you using? As of version 9.6, Tridion Sites exposes a REST API, which is easier to interface with from all kinds of languages, including PowerShell 7. Commented Nov 18 at 8:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.