Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function Get-HTCOrder
- {
- [CmdletBinding()]
- [Alias()]
- Param
- (
- # Param1 help description
- [Parameter(Mandatory=$true)]
- [String]
- $OrderID,
- # Param2 help description
- [Parameter(Mandatory=$true)]
- [string]
- $Password
- )
- Begin
- {
- }
- Process
- {
- $LoginURL = "https://store.us.htc.com/DRHM/store"
- $StatusPageURL = "https://store.us.htc.com/DRHM/store?Action=DisplayCustomerServiceOrderDetailPage&SiteID=htcus&Locale=en_US&ThemeID=38736100&Env=BASE&requisitionID=$OrderID"
- $Params = @{ "Action" = "PostFindOrderPages"
- "SiteID" = "htcus"
- "Locale" = "en_US"
- "ThemeID" = "3873600"
- "Form" = "com.digitalriver.template.form.search.FindOrderV2Form"
- "CallingPageID" = "HelpPage"
- "Env" = "BASE"
- "ORIG_Value_operation" = "update"
- "operation" = "search"
- "orderNumber" = "$OrderID"
- "password" = "$Password"
- }
- $session = Invoke-WebRequest -URI $LoginURL -Method POST -body $params -SessionVariable HTCCookie
- $a = Invoke-WebRequest -uri $StatusPageURL -Method GET -WebSession $HTCCookie
- write-output ($a.ParsedHtml.getElementsByTagName("p") | ?{$_.classname -eq "dr_additionalInfo"}).innertext
- Remove-Variable session
- Remove-Variable a
- }
- End
- {
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement