I have a URL that a batch scheduling program needs to call to do some processing. I the problem is that the webpage needs to stay open until processing is complete and I believe the script below opens and closes the URL before processing can even start. Is there a way to have the script launch the URL and wait for the processing to complete before closing it?
:Set &URI# = "https://internal webserverhere/Runtime/Runtime/View/DocDocumentDistributionLog.ListView/?inProcessPendingRecordsFlag=Y"
!$r = Invoke-WebRequest -URI "&URI#" -UseDefaultCredential
:include DC.INCL.POWERSHELL.ERROR.HANDLER
! $r is a WebResponseObject with the following properties;
! https://msdn.microsoft.com/en-us/library/microsoft.powershell.commands.webresponseobject_members(v=vs.85).aspx
write-host "StatusCode " $r.StatusCode " " $r.StatusDescription
write-host "Returned data length is " $r.RawContentLength
write-host "Baseresponse is " $r.Baseresponse
write-host "Content is " $r.Content