Last active
April 24, 2017 14:39
-
-
Save omerfarukz/81e9a16d35aa3baf1eb4d6c48825a701 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$response = (curl "http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types") | |
$headerPassed = $False | |
ForEach ($line in $($response.Content -split '[\r\n]')) { | |
if ($headerPassed -eq $False) { | |
$headerPassed = $line.StartsWith("# =") | |
continue | |
} | |
else | |
{ | |
$mime = $null; | |
$extensions = $null; | |
if($line.StartsWith("#")) { | |
$mime = $line.Substring(2) | |
} | |
else | |
{ | |
$m, $e = ($line -split '\t') | |
$mime = $m | ? {$_} | |
$extensions = $e | ? {$_} | |
} | |
"MIME: $mime E: $extensions" | |
ForEach ($e in $extensions -split ' ' | ? {$_}) { | |
$e | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment