Hi,
I am downloading one file extension (.tgz) from splunk website which has a license agreement so in order to download the file first you have to login splunk and then it shows the page of license agreement and when you accept it then file will be visible for downloading. I have made one script in which it is successfully logged in the splunk account and downloading the file but not fully. The file size is around 104 kb but it is downloading 44.7kb so anybody can help me please in order to complete this task? Here is my code -
$postParams = @{username=‘username’;password=‘password’}
Invoke-WebRequest -Uri The IT Search Engine | Splunk
-Method POST -Body $postParams
$url = “The IT Search Engine | Splunk”
$downloadpath = “C:\Users\ankitpar\Downloads\splunk-addon-for-microsoft-azure_102.tgz”
Invoke-WebRequest -Uri $url -OutFile $downloadpath
if you will run above given script upto the second line so it shows in output of powershell that HTTP response 200 OK connection keep-alive which means i have successfully logged in.
Thanks in advance
Ankit