Associate
- Joined
- 23 Mar 2010
- Posts
- 730
nice...thanks
Very nice.
Thanks for your job.
It would be so nice to show us how you compile your xml file from adblock plus filter list.
What script to execute into PowerShell ?
Thank you.
Very nice.
...What script to execute into PowerShell ?
Thank you.
Get-Content input.txt | foreach { $_ = $_.trim(); $_ } | foreach {
$_ = @"
<item>
<description>$_</description>
<wf:blockRegex>
<![CDATA[$_]]>
</wf:blockRegex>
<[COLOR="Red"]/[/COLOR]item>
"@; $_ } | foreach { Add-Content output.txt $_ }
Thanks again for this, I've been telling some associates.
foreach { $_.trim() }
It's amazing!
And I never make mistakes! You just made that up!
Actually looking at it again the first foreach block could probably be shortened to
Code:foreach { $_.trim() }
If the result of a method isn't assigned to anything, it gets dumped out to the pipeline anyway - no need to assign it to $_ just to dump it again.
I don't suppose this has been updated to take care of the hotmail adds since the face lift that happened today?
Sorry, missed your post. Theres was something missing in the original one (highlighted in red). It should be:
Code:Get-Content input.txt | foreach { $_ = $_.trim(); $_ } | foreach { $_ = @" <item> <description>$_</description> <wf:blockRegex> <![CDATA[$_]]> </wf:blockRegex> <[COLOR="Red"]/[/COLOR]item> "@; $_ } | foreach { Add-Content output.txt $_ }
Found out the hard way 1st time I ran it
I've been reading all the powershell tutorials on technet, its quite a very useful tool