I have a PowerShell script shown below that is showing data in a table then a picture of a graph. The trouble i have right at the end of the script is that i need a page break to move onto my next item but if i insert a pagebreak after the insertion of the picture the word document shows the page break before the picture and the picture ends up on the next page. Can you help please
$selection.Style="Heading 1"$Selection.TypeText("Tools Reports")$Selection.TypeParagraph()$selection.Style="Heading 2"$Selection.TypeText("HPSim Data")$Selection.TypeParagraph()$selection.Style="Normal"$Selection.TypeText("The table below shows the status of HPSim Agents at Braintree AD")$Selection.TypeParagraph()$selection.Style="Normal"$objRange=$Selection.Range$UserTable=$Word.ActiveDocument.Tables.Add($Word.Selection.Range, 1, 4) $UserTable=$objDoc.Tables.Item(1)$UserTable.Cell(1,1).Range.Text ="Measured Item"$UserTable.Cell(1,2).Range.Text =$A1$UserTable.Cell(1,3).Range.Text =$A2$UserTable.Cell(1,4).Range.Text =$A3$UserTable.Rows.Add()$UserTable.Cell(2,1).Range.Text ="Servers in Active Directory"$UserTable.Cell(2,2).Range.Text =$B1$UserTable.Cell(2,3).Range.Text =$B2$UserTable.Cell(2,4).Range.Text =$B3$UserTable.Rows.Add()$UserTable.Cell(3,1).Range.Text ="Servers Audited"$UserTable.Cell(3,2).Range.Text =$C1$UserTable.Cell(3,3).Range.Text =$C2$UserTable.Cell(3,4).Range.Text =$C3$UserTable.Rows.Add()$UserTable.Cell(4,1).Range.Text ="HPSim Running"$UserTable.Cell(4,2).Range.Text =$D1$UserTable.Cell(4,3).Range.Text =$D2$UserTable.Cell(4,4).Range.Text =$D3$UserTable.Rows.Add()$UserTable.Cell(5,1).Range.Text ="% of AD Servers with HPSim Running"$UserTable.Cell(5,2).Range.Text =$E1$UserTable.Cell(5,3).Range.Text =$E2$UserTable.Cell(5,4).Range.Text =$E3$UserTable.Rows.Add()$UserTable.Cell(6,1).Range.Text ="% of Audited Servers with HPSim Running"$UserTable.Cell(6,2).Range.Text =$F1$UserTable.Cell(6,3).Range.Text =$F2$UserTable.Cell(6,4).Range.Text =$F3$Selection.EndKey($END_OF_STORY)$selection.MoveDown()$UserTable.AutoFormat(23)$UserTable.Columns.AutoFit()$Selection.TypeParagraph()$selection.Style="Heading 2"$Selection.TypeText("HPSim Chart")$Selection.TypeParagraph()$selection.Style="Normal"$Selection.TypeText("The Chart below shows the trend of HPSim Agents at Braintree over 6 weeks")$Selection.TypeParagraph()$selection.Style="Normal"$objShape=$objDoc.Shapes $objShape.AddPicture("C:\DataReporting\Files\Reporting\Braintree\HPSIM.PNG")$Selection.InsertNewPage()