I am creating a PowerShell script which traverses through the CMS Structure Group and gets individual Page TCM id which was published from the Publication.
I am able to get the list of the Pages which are published using the script. I am not able to get the version of the page which was published.
I want to publish that particular version of the Page using the PowerShell script
Sample Script:
#Create SearchQueryData to Query the Pages publication wise and filter with isPublished
$filter = New-Object SearchQueryData
$filter.BaseColumns += @([Tridion.ContentManager.CoreService.Client.ListBaseColumns]::Extended)
$filter.ResultLimit = 1000
$filter.ItemTypes += @([Tridion.ContentManager.CoreService.Client.ItemType]:: Page)
#Checking if the page is published
$filter.IsPublished = "True"
$filter.SearchIn = New-Object LinkToIdentifiableObjectData
$filter.SearchIn.IdRef = "TCMID_OF_STRUCTURE_GROUP"#$SystemWideItem.ID
$filter.SearchInSubtree = $true
#Get Page list based on the publication id and SearchQueryData filter
$temp = 0
#Creating the search node object to capture the result set
$xname = [System.Xml.Linq.XName]"SerachNode$temp"
$smlem = new-Object System.Xml.Linq.XElement $xname
$smlem = $client.GetSearchResultsXml($filter)
foreach($node in $smlem.Nodes())
{
#$node
Write-Host "TCM ID:" $node.Attribute(“ID”).Value
$subtype= $node.Attribute(“SubType”).Value
}