nottyheadedboss

PowerShell - Convert System-Object to String

Jan 12th, 2018
278
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #SPLIT Incident IDs
  2.  
  3. $IncidentID = "INC0010178~INC0010189"
  4. $SysID = "2b3b203edb2f4300479a7e7dbf961900~9d503cbedb2f4300479a7e7dbf96194a"
  5.  
  6. $Incidents = $IncidentID -split '~'
  7. $SystemIDs = $SysID -split '~'
  8.  
  9. $iLoopCount = 0
  10.  
  11. $oTicketData = foreach($Inc in $Incidents)
  12. {
  13. "<BR>The Incident ID is $($Incidents[$iLoopCount]) <BR> The URL is - https://xxxxxxxx.service-now.com/task.do?sys_id=$($SystemIDs[$iLoopCount])"
  14. $iLoopCount++
  15. }
  16.  
  17. #foreach ($oTicketDatum in $oTicketData) {$oTicketDatum.ToString()}
  18.  
  19. #DEFINING VARIABLES FOR OUTLOOK
  20. $BodyHTML = "Dear Admin,
  21. <BR><BR>Below is the URL Activity and the current Response Times.
  22. <BR>The non-Working URL is HIGHLIGHTED in <font color=red>RED.</font>
  23.  
  24. <BR>Incidents have been created in  for your convenience.
  25.  
  26. Out-String -InputObject $oTicketData
  27.                                  
  28. <CENTER>$Outputreport</CENTER>
  29. <BR><BR>Regards,
  30. <BR>Support Team"
  31.  
  32. $BodyHTML
Add Comment
Please, Sign In to add comment