$wcl = New-Object Net.Webclient #$wcl.Credentials = new-object Net.NetworkCredential("user", "pwd", "COMMUN") #$wcl.Proxy.Credentials = new-object Net.NetworkCredential("user", "pwd", "COMMUN"); Function ParseFlashCode($code) { #$code=1105 $uri = new-object System.Uri "http://m.tcl.fr/flashcode/flashcode.do?code=$code" $result = $wcl.DownloadString($uri) #$webrequestobject=[System.Net.WebRequest]::Create($uri) #$response=$webrequestobject.GetResponse() #$reqstream = $response.GetResponseStream() #$sr = new-object System.IO.StreamReader $reqstream #$result = $sr.ReadToEnd() #write-host $result filter Get-Matches($Pattern) { $_ | Select-String -AllMatches $pattern | Select-Object -ExpandProperty Matches | Select-Object -ExpandProperty Value } #write-host 'full page is in $result' #write-host $result $Stop=if (($result | Get-Matches 'Horaires - [^<]+') -match '(.*)') { $matches[1] } #write-host "l'arrêt"'est $Stop'"= $Stop" #$LinesDest = $result | Get-Matches ']*toutes-les-lignes[^>]*/>' | foreach { if ($_ -match 'title="(.*)"') { $matches[1] } } $LinesDest2 = $result | Select-String -AllMatches '(]*toutes-les-lignes[^>]*/>)|(([^<]+)<') { $ns0 | Add-Member -type NoteProperty -name Destination -value $matches[1] } if (-not $data -match '(\