BSW.Blog

Extract CSS Class Names From Multiple Files Using Regular Expression in Powershell.

PS C:\> cat *.css| %{[System.Text.RegularExpressions.Regex]::Matches($_,"[^\d:](\.[\w-]{1,})[\ \{:\r\n\[]")} |%{$_.Groups[1].value} |sort -Unique

Now Upgraded Version

PS C:\css> cat *.css| %{[System.Text.RegularExpressions.Regex]::Matches($_,"(\.[^\d ][\w-]{1,})[ \r\n\t,:\{]*")} |%{$_.Groups[1].value} |sort -Unique

and Again Upgraded Version

PS C:\css> cat *.css| %{[System.Text.RegularExpressions.Regex]::Matches($_,"(?:[^\w])\.(?<g>[^\d/ ][\w-]{1,})|^\.(?<g>[^\d/ ][\w-]{1,})")} |%{$_.Groups[1].value} |sort -Unique

Babak
#CSS #Powershell #Multiple #File #Class #CSS3 #Regex #Regular #Regexp #Regular Expression
5/15/2014 5:29:49 PM
Write Comment

View Internet Explorer 11 Cookies Using Powershell With simple script:

you can run the script below view your cookies without need to run applications so you'll be sure about malware and viruses in application.

soon I'll create the cookie manager script 

Tested on Windows 8.1 with IE11

dir "$([Environment]::GetFolderPath("Cookies"))\low" | %{
    $str=(cat $_.fullname);
    $q=New-Object "System.Collections.Generic.Queue[string]" 
    $str|%{$q.Enqueue($_)}
    while($q.Count -gt 0 ){
    New-Object psobject -Property (@{
                                    Name=$q.Dequeue();
                                    Value=$q.Dequeue();
                                    Domain=$q.Dequeue();
                                    Flags=$q.Dequeue();
                                    Expire= [System.DateTime]::FromFileTime([long]$q.Dequeue()+[long]$q.Dequeue()*[math]::pow(2,32)) ;
                                    Creation=  [System.DateTime]::FromFileTime([long]$q.Dequeue()+[long]$q.Dequeue()*[math]::pow(2,32)) ;
                                    Delim=$q.Dequeue();
                                    Filename=$_.Name;
                                    }
                                    )
    }
    } | Out-GridView

Babak
#Powershell #File #safe #Script #Windows #IE #IE11 #InternetExplorer #Source #Cookie #Cookies #View Cookies #GridView #Parse #Parse Cookie #Parse Cookie Files #Browse #free #Generic #Collections #Queue #GenericQueue
7/5/2015 8:48:50 AM
Write Comment