Advertisement
Guest User

Untitled

a guest
Mar 31st, 2016
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function Get-HTCOrder
  2. {
  3.     [CmdletBinding()]
  4.     [Alias()]
  5.     Param
  6.     (
  7.         # Param1 help description
  8.         [Parameter(Mandatory=$true)]
  9.         [String]
  10.         $OrderID,
  11.  
  12.         # Param2 help description
  13.         [Parameter(Mandatory=$true)]
  14.         [string]
  15.         $Password
  16.     )
  17.  
  18.     Begin
  19.     {
  20.     }
  21.     Process
  22.     {
  23.     $LoginURL = "https://store.us.htc.com/DRHM/store"
  24.     $StatusPageURL = "https://store.us.htc.com/DRHM/store?Action=DisplayCustomerServiceOrderDetailPage&SiteID=htcus&Locale=en_US&ThemeID=38736100&Env=BASE&requisitionID=$OrderID"
  25.     $Params = @{ "Action" = "PostFindOrderPages"
  26.             "SiteID" = "htcus"
  27.             "Locale" = "en_US"
  28.             "ThemeID" = "3873600"
  29.             "Form" = "com.digitalriver.template.form.search.FindOrderV2Form"
  30.             "CallingPageID" = "HelpPage"
  31.             "Env" = "BASE"
  32.             "ORIG_Value_operation" = "update"
  33.             "operation" = "search"
  34.             "orderNumber" = "$OrderID"
  35.             "password" = "$Password"
  36.             }
  37.     $session = Invoke-WebRequest -URI $LoginURL -Method POST -body $params -SessionVariable HTCCookie
  38.     $a = Invoke-WebRequest -uri $StatusPageURL -Method GET -WebSession $HTCCookie
  39.     write-output ($a.ParsedHtml.getElementsByTagName("p") | ?{$_.classname -eq "dr_additionalInfo"}).innertext
  40.     Remove-Variable session
  41.     Remove-Variable a
  42.     }
  43.     End
  44.     {
  45.     }
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement