<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Everything is Crap &#187; powershell</title>
	<atom:link href="http://everythingiscrap.com/tag/powershell/feed/" rel="self" type="application/rss+xml" />
	<link>http://everythingiscrap.com</link>
	<description>Notes on the crap we&#039;ve been subjected to</description>
	<lastBuildDate>Wed, 11 Jan 2012 21:10:15 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Execute local scripts in PowerShell</title>
		<link>http://everythingiscrap.com/execute-local-scripts-in-powershell/</link>
		<comments>http://everythingiscrap.com/execute-local-scripts-in-powershell/#comments</comments>
		<pubDate>Fri, 27 Feb 2009 23:07:00 +0000</pubDate>
		<dc:creator>paul</dc:creator>
				<category><![CDATA[powershell]]></category>

		<guid isPermaLink="false">http://piotrouble.wordpress.com/2009/02/27/execute-local-scripts-in-powershell</guid>
		<description><![CDATA[I run into this all the time. I install PowerShell, go to run a .ps1 script and it yells at me saying that the script is not digitally signed. The script will not execute on the system. Please see "get-help about_signing" for more details&#8230; To fix it you'll need to execute this command: Set-ExecutionPolicy RemoteSigned [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-medium wp-image-263" title="powershell1" src="http://everythingiscrap.com/wp-content/uploads/2009/02/powershell1-300x221.jpg" alt="" width="300" height="221" /></p>
<p>I run into this all the time. I install PowerShell, go to run a .ps1 script and it yells at me saying that the script</p>
<blockquote><p>is not digitally signed. The script will not execute on the system. Please see "get-help about_signing" for more details&#8230;</p></blockquote>
<p>To fix it you'll need to execute this command:</p>
<blockquote><p>Set-ExecutionPolicy RemoteSigned</p></blockquote>
<p>(And in Windows 7 you'll need to have Administrator rights in the console windows as well because it edits a registry key)</p>
<p>Technically, you're introducing a security vulnerability, but there's no way I'm going to sign every little script that I write. That's just asking too much!</p>
]]></content:encoded>
			<wfw:commentRss>http://everythingiscrap.com/execute-local-scripts-in-powershell/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Powershell Spamming Machine</title>
		<link>http://everythingiscrap.com/powershell-spamming-machine/</link>
		<comments>http://everythingiscrap.com/powershell-spamming-machine/#comments</comments>
		<pubDate>Mon, 03 Dec 2007 21:55:00 +0000</pubDate>
		<dc:creator>paul</dc:creator>
				<category><![CDATA[powershell]]></category>
		<category><![CDATA[scripting]]></category>

		<guid isPermaLink="false">http://piotrouble.wordpress.com/2007/12/03/powershell-spamming-machine</guid>
		<description><![CDATA[Another scripting day&#8230;I'm now a spammer!  $MyReader = new-object     System.IO.StreamReader("C:message.txt"); $message = $MyReader.ReadToEnd(); $MyReader.Close(); #$message = Get-Content -encoding UTF8 -path C:email.txt    foreach ($user in Get-Content C:names.txt) {       $smtp = new-object           Net.Mail.SmtpClient("mail.myserver.com")        $smtp.Send("Me &#60;me@email.com&#62;",          "$user", "Subject", $message)       } The script [...]]]></description>
			<content:encoded><![CDATA[<div>
<div>Another scripting day&#8230;I'm now a spammer! </div>
<div></div>
<div></div>
<blockquote><div>$MyReader = new-object </div>
<div>   System.IO.StreamReader("C:message.txt");</div>
<div>$message = $MyReader.ReadToEnd();</div>
<div>$MyReader.Close();</div>
<div></div>
<div>#$message = Get-Content -encoding UTF8 -path C:email.txt</div>
<div></div>
<div>   foreach ($user in Get-Content C:names.txt) {</div>
<div>      $smtp = new-object </div>
<div>         Net.Mail.SmtpClient("mail.myserver.com") </div>
<div>      $smtp.Send("Me &lt;me@email.com&gt;",</div>
<div>         "$user", "Subject", $message)</div>
<div>      }</div>
<div></div>
</blockquote>
<div></div>
<div>The script reads in a text file that contains the e-mail message, then it emails everybody listed (one per line) in another file. Pretty simple, but it took me a while to figure it out (about 45 minutes). Boom. Instant spamming machine.</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://everythingiscrap.com/powershell-spamming-machine/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title></title>
		<link>http://everythingiscrap.com/17/</link>
		<comments>http://everythingiscrap.com/17/#comments</comments>
		<pubDate>Thu, 01 Nov 2007 18:45:00 +0000</pubDate>
		<dc:creator>paul</dc:creator>
				<category><![CDATA[powershell]]></category>
		<category><![CDATA[scripting]]></category>

		<guid isPermaLink="false">http://piotrouble.wordpress.com/2007/11/01/17</guid>
		<description><![CDATA[I made a PowerShell script today. It copies only the most recent file in one directory to another directory and e-mails me a simple status report. Let me show you the script&#8230; gci c:source &#124; sort LastWriteTime -desc &#124; select -first 1 &#124;   cpi -dest c:destination -ea SilentlyContinue -ev copyerr if($copyerr.count -gt 0) {   $smtp [...]]]></description>
			<content:encoded><![CDATA[<div>I made a PowerShell script today. It copies only the most recent file in one directory to another directory and e-mails me a simple status report. Let me show you the script&#8230;</div>
<div></div>
<div>
<div></div>
<blockquote><div>gci c:source | sort LastWriteTime -desc | select -first 1 |</div>
<div>  cpi -dest c:destination -ea SilentlyContinue -ev copyerr</div>
<div></div>
<div>if($copyerr.count -gt 0)</div>
<div>{</div>
<div>  $smtp = new-object</div>
<div>     Net.Mail.SmtpClient("mail.myserver.com")</div>
<div>  $smtp.Send("My Name &lt;my@email.com&gt;",</div>
<div>     "recipient@email.com", "Error copying file",</div>
<div>     "Copy failed with the following error message: " + $copyerr)</div>
<div>}</div>
<div>else</div>
<div>{</div>
<div>  $smtp = new-object</div>
<div>     Net.Mail.SmtpClient("mail.myserver.com")</div>
<div>  $smtp.Send("My Name &lt;my@email.com&gt;",</div>
<div>     "recipient@email.com", "File copied successfully", "Sweet.")</div>
<div>}</div>
<div></div>
</blockquote>
<div></div>
</div>
<div></div>
<div>&#8230;so this loaded script does a lot in the first line. It finds all the files in the source folder, sort's them by LastWriteTime, selects the first one, and copies that file to the desired location. Errors are logged in copyerr, and if any errors are found in copyerr then I get an e-mail saying that it didn't succeed. Otherwise I get an e-mail saying that it did.</div>
<div></div>
<div>My first useful powershell script! I think I like powershell.</div>
]]></content:encoded>
			<wfw:commentRss>http://everythingiscrap.com/17/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

