Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

String Comparison based on EXE output

$
0
0

I got the code below

$URL = "http://content3.catalog.video.msn.com/e2/ds/3416835b-d0fc-412a-8de5-d2101ff48341.mp4"
$wget = "C:\Program Files (x86)\GnuWin32\bin\wget.exe"
$URLfilesize = &$wget -S --spider $URL | Out-String

I have used wget to download, I know there are powershell commands to do it but I prefer wget for some reason. I get the output as below

HTTP request sent, awaiting response...
  HTTP/1.0 200 OK
  Content-Length: 511726956
  Content-Type: video/mp4
  Last-Modified: Wed, 14 May 2014 16:14:31 GMT
  Accept-Ranges: bytes
  Server: Microsoft-IIS/8.0
  Access-Control-Allow-Origin: *
  X-AspNet-Version: 4.0.30319
  X-Powered-By: ASP.NET
  Cache-Control: public, max-age=915969
  Expires: Thu, 12 Jun 2014 03:39:48 GMT
  Date: Sun, 01 Jun 2014 13:13:39 GMT
  Connection: keep-alive
Length: 511726956 (488M) [video/mp4]
Remote file exists.

How do I continue from there so that I get the Length: 511726956 (488M) [video/mp4] (Only the bold and highlighted)

Also, is there a way that masked the above output so that it will not be displayed on the console?

I know there are methods to pipe to a file and then grab the content but I prefer the output to go directly to a string and we can manipulate the values from there?




Thanks


Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>