2

I want to create a root Business Process Type using Tridion Core Service Session Aware Client (8.5). But I have a problem creating a Business process type.

using namespace Tridion.ContentManager.CoreService.Client
Using namespace System.Uri
Import-Module Tridion-CoreService

$user = "domain\user"
if(-not $credential){
    $credential = Get-Credential -UserName $user -Message "Remote Server Tridion Administrator Account"
}


$tcsconnection = @{
        hostname       = "cms.poc2.domain.internal"
        version        = "Web-8.5"   # 2011-SP1, 2013, 2013-SP1, Web-8.1, Web-8.5
        ConnectionType = "default"    # Default, SSL, LDAP, LDAP-SSL, netTcp, Basic, Basic-SSL
        CredentialType = "Windows"
}
Set-TridionCoreServiceSettings @tcsconnection 

$settings = Get-TridionCoreServiceSettings

try
{
    $client = Get-TridionCoreServiceClient
    $client.ChannelFactory.Credentials.Windows.ClientCredential = $credential
    $client.GetApiVersion()
}

catch 
{
    Write-Output "Failed to connect TridionCoreService on $($tcsconnection.hostname)"
}

$businessProcessType = New-Object BusinessProcessTypeData
$businessProcessType.Title = "DooHickey"

8.5.0

The property 'Title' cannot be found on this object. Verify that the property exists and can be set. At line:35 char:1 + $businessProcessType.Title = "DooHickey" + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [], RuntimeException + FullyQualifiedErrorId : PropertyAssignmentException

  • Weird. What do you get if you do Get-Member $businessProcessType ? – Rick Pannekoek May 25 '18 at 6:27
  • BTW, your error handling is a bit dubious: if connection fails, you write an (informative) message to the output and try to continue... :-) – Rick Pannekoek May 25 '18 at 6:32
  • This is just an test example not real code – Chris Mills May 25 '18 at 7:57
1

Logged in on new session and problem was gone. No ideas why it would not work yesterday. Thanks to Rick for Get-Member suggestion.

  • Just a note that when creating new items, I suggest to always call $client.GetDefaultData instead of creating the data object yourself. That will initialize a lot of the properties for you. – Peter Kjaer May 25 '18 at 11:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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