Manipulating conditions for publications using ISHRemote

I want to set conditions for a bunch of publications at once using a script. I looked into the Cmdlet list of ISHRemote, but I couldn't find one that can manipulate a publication's conditions. Is it possible to manipulate publication conditions using ISHRemote?

emoji
Parents
  • Hi Naoki,

    Technically we call it a System field, so for Tridion Docs purposes only. It has however not changed for 10+ years, so let's hope it does not change in the future either... a disclaimer Slight smile

    Below some pseudo code that should bring you really close 

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    # Remember the below is your friend in browsing through fields
    Get-IshTypeFieldDefinition | Out-GridView
    # Retrieving the System field that holds this information
    $ishObject = Get-IshPublicationOutput -IshObject $ishObject -RequestedMetadata (Set-IshRequestedMetadataField -Level Version -Name FISHPUBCONTEXT)
    # Printing the information
    [xml]$context = $ishObject.fishpubcontext_version_value
    # <?xml version="1.0" encoding="utf-16"?>
    # <features>
    # <feature name="BLUETOOTH" value="Y" />
    # <feature name="GAMES" value="DJ" />
    # <feature name="GAMES" value="SNAKE" />
    # <feature name="GAMES" value="WATERRAPIDS" />
    # <feature name="GPRS" value="Y" />
    # <feature name="HEADSET" value="Y" />
    # <feature name="LOUDSPEAKER" value="Y" />
    # <feature name="MODEL" value="330" />
    # </features>
    # Preferably changing xml with proper XmlDocument functions to keep it valid/welformed like for example switching HEADSET from Y to N
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Remember that ISHRemote expect fully initialized logical-version-language entries. Earlier Tridion Docs versions allowed creation of Publication Versions (so logical-version) while later versions will enforce more complete hierarchies PublicationOutput (so logical-version-language). ISHRemote can only work with the latter - PublicationOutputs.

    Best wishes,
    Dave

    emoji
  • Hi Dave,

    Thank you for sharing the sample code. I'll try to create my own code based on this sample code.

    Kind regards,

    Naoki

    emoji
Reply Children
No Data