<?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>Huddled Masses &#187; Pastebin</title>
	<atom:link href="http://huddledmasses.org/tag/pastebin/feed/" rel="self" type="application/rss+xml" />
	<link>http://huddledmasses.org</link>
	<description>You can do more than breathe for free...</description>
	<lastBuildDate>Sat, 28 Jan 2012 21:37:20 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<cloud domain='huddledmasses.org' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
		<item>
		<title>RSS Feed for PowerShell Script Repository</title>
		<link>http://huddledmasses.org/rss-feed-for-powershell-script-repository/</link>
		<comments>http://huddledmasses.org/rss-feed-for-powershell-script-repository/#comments</comments>
		<pubDate>Wed, 04 Jun 2008 04:31:52 +0000</pubDate>
		<dc:creator>Joel 'Jaykul' Bennett</dc:creator>
				<category><![CDATA[Huddled]]></category>
		<category><![CDATA[Feed]]></category>
		<category><![CDATA[Pastebin]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Recent]]></category>
		<category><![CDATA[Repository]]></category>
		<category><![CDATA[RSS]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Scripts]]></category>

		<guid isPermaLink="false">http://HuddledMasses.org/?p=549</guid>
		<description><![CDATA[There are two requests that I get with overwhelming regularity for the PowerShell script repository: first, that I would add some sort of &#8220;browsing&#8221; functionality, and second, that it should have an RSS feed. Well, browsing may have to wait until a future iteration of the repository, but feeds are easy, because they&#8217;re basically just [...]]]></description>
			<content:encoded><![CDATA[	<p>There are two requests that I get with overwhelming regularity for the PowerShell script repository: first, that I would add some sort of &#8220;browsing&#8221; functionality, and second, that it should have an <span class="caps">RSS</span> feed. Well, browsing may have to wait until a future iteration of the repository, but feeds are easy, because they&#8217;re basically just a hack-up of the &#8220;recent&#8221; items that are in the repository sidebar already, so I did it this evening.</p>

	<h2>Presenting &#8230;</h2>

	<p><a href="http://PowerShellCentral.com/scripts/feed">PowerShellCentral.com/scripts/feed</a></p>

	<p>Right now the number of items is limited to <em>about</em> ten, but if traffic picks up I can increase that easily &#8212; you can limit the count by passing the number of items you want to list like this: <a href="http://powershellcentral.com/scripts/feed.php?list=2">?list=2</a>.</p>

	<p>You can also create a feed for specific search results (the feed will show items in relevance order, but the date is in the <span class="caps">RSS</span> so if you want to sort by that, you can).  For instance, if you wanted to keep up to date on scripts that used SecureStrings, you would append your search terms like this: <a href="http://powershellcentral.com/scripts/feed?q=*securestring*">?q=*securestring*</a>.   <img src='http://huddledmasses.org/wordpress/wp-includes/' alt=':)' class='wp-smiley' /> </p>

	<p>As usual, my modifications to the PasteBin.com site are available <a href="http://PowerShellCentral.com/scripts/pastebin.7z">on the repository site</a>, and without much in the way of documentation.  I will say this: in addition to creating the feed.php file, I moved some of the common translation functions into a <em>translate.php</em> file, and modified the dates that were being returned from <em>db.mysql.class.php</em> &#8212; it&#8217;s all under the <a href="http://www.affero.org/oagpl.html">Affero General Public License</a> that <a href="http://blog.dixo.net/category/pastebin/">Paul Dixon</a> wrote <a href="http://PasteBin.com">PasteBin</a> under in the first place.</p>]]></content:encoded>
			<wfw:commentRss>http://huddledmasses.org/rss-feed-for-powershell-script-repository/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PowerShell Send-Paste script</title>
		<link>http://huddledmasses.org/powershell-send-paste-script/</link>
		<comments>http://huddledmasses.org/powershell-send-paste-script/#comments</comments>
		<pubDate>Tue, 22 Apr 2008 18:41:18 +0000</pubDate>
		<dc:creator>Joel 'Jaykul' Bennett</dc:creator>
				<category><![CDATA[Huddled]]></category>
		<category><![CDATA[Pastebin]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Upload]]></category>

		<guid isPermaLink="false">http://HuddledMasses.org/powershell-send-paste-script/</guid>
		<description><![CDATA[In the #PowerShell IRC channel (on irc.freenode.net) we have a bot and pastebin (which is set up here on my site) ... if you paste something in the pastebin site, the bot posts a link to it in the IRC channel for you, so you don&#8217;t have to mess with copying the resulting URL and [...]]]></description>
			<content:encoded><![CDATA[	<p>In the #PowerShell <span class="caps">IRC</span> channel (on irc.freenode.net) we have a bot and pastebin (which is set up <a href="http://posh.jaykul.com/p/">here</a> on my site) ... if you paste something in the pastebin site, the bot posts a link to it in the <span class="caps">IRC</span> channel for you, so you don&#8217;t have to mess with copying the resulting <span class="caps">URL</span> and pasting it to the channel to ask for help. </p>

	<p>I also run a version of pastebin that&#8217;s been modified for long term storage as the main <a href="http://PowerShellCentral.com/scripts/">PowerShell Script Repository</a> (which is, among other things, the main repository for the <a href="http://PowerShellCommunity.org/">PowerShell Community</a>).</p>

	<p>So, when someone showed me <a href="http://sprunge.us">sprunge</a> earlier today, along with a python script for pasting there &#8230; I couldn&#8217;t help but think that it would be nice to have that for our pastebin sites&#8230; so here it is, Send-Paste</p>

	<div class="posh code posh" style="font-family:monospace;"><br />
<span style="color: #666666; font-style: italic;">## Send-Paste.ps1 (aka sprunge for Pastebin)</span><br />
<span style="color: #666666; font-style: italic;">##############################################################################################################</span><br />
<span style="color: #666666; font-style: italic;">## Uploads code to any pastebin.com based pastebin site and returns the url for you.</span><br />
<span style="color: #666666; font-style: italic;">##############################################################################################################</span><br />
<span style="color: #666666; font-style: italic;">## Usage:</span><br />
<span style="color: #666666; font-style: italic;">## &nbsp; &nbsp;get-content myscript.ps1 | Send-Paste &quot;An example for you&quot; &quot;This is just to show how to do it&quot;</span><br />
<span style="color: #666666; font-style: italic;">## &nbsp; &nbsp; &nbsp; would send the script with the specified title and description</span><br />
<span style="color: #666666; font-style: italic;">## &nbsp; &nbsp;ls *.ps1 | Send-Paste -Keep Forever</span><br />
<span style="color: #666666; font-style: italic;">## &nbsp; &nbsp; &nbsp; would flood the pastebin site with all your scripts, using filename as the title</span><br />
<span style="color: #666666; font-style: italic;">## &nbsp; &nbsp; &nbsp; and a generic description, and mark them for storing indefinitely</span><br />
<span style="color: #666666; font-style: italic;">## &nbsp; &nbsp;get-history -count 5 | % { $_.CommandLine } | Send-Paste</span><br />
<span style="color: #666666; font-style: italic;">## &nbsp; &nbsp; &nbsp; would paste the last 5 commands in your history!</span><br />
<span style="color: #666666; font-style: italic;">##############################################################################################################</span><br />
<span style="color: #666666; font-style: italic;">## History:</span><br />
<span style="color: #666666; font-style: italic;">## v 2.0 - works with &quot;pastebin&quot; (including http://posh.jaykul.com/p/ and http://PowerShellCentral.com/Scripts/)</span><br />
<span style="color: #666666; font-style: italic;">## v 1.0 - Worked with a special pastebin</span><br />
<span style="color: #666666; font-style: italic;">##############################################################################################################</span><br />
<span style="color: #666666; font-style: italic;">#function Send-Paste {</span><br />
<span style="color: #666699; font-weight: bold;">param</span><span style="color: #333;">&#40;</span> <br />
&nbsp; &nbsp;<span style="color: #660033; font-weight: bold;">$Title</span>, <br />
&nbsp; &nbsp;<span style="color: #660033; font-weight: bold;">$Description</span><span style="color: #66cc66;">=</span><span style="color: #009900;">&quot;Automated paste from PowerShell console&quot;</span>, <br />
&nbsp; &nbsp;<span style="color: #660033; font-weight: bold;">$KeepFor</span><span style="color: #66cc66;">=</span><span style="color: #009900;">&quot;d&quot;</span>, <br />
&nbsp; &nbsp;<span style="color: #660033; font-weight: bold;">$Language</span><span style="color: #66cc66;">=</span><span style="color: #009900;">&quot;posh&quot;</span>, <br />
&nbsp; &nbsp;<span style="color: #660033; font-weight: bold;">$Author</span> <span style="color: #66cc66;">=</span> $<span style="color: #333;">&#40;</span><span style="color: #0066cc; font-style: italic;">Read-<span style="font-style: normal;">Host</span></span> <span style="color: #009900;">&quot;Your name&quot;</span><span style="color: #333;">&#41;</span>, <br />
&nbsp; &nbsp;<span style="color: #660033; font-weight: bold;">$url</span><span style="color: #66cc66;">=</span><span style="color: #009900;">&quot;http://posh.jaykul.com/p/&quot;</span> <br />
<span style="color: #333;">&#41;</span><br />
&nbsp; &nbsp;<br />
<span style="color: #666699; font-weight: bold;">BEGIN</span> <span style="color: #333;">&#123;</span><br />
&nbsp; &nbsp;<span style="color: #660033; font-weight: bold;">$null</span> <span style="color: #66cc66;">=</span> <span style="color: #003366; font-weight: bold;"><span style="color: #333;">&#91;</span>Reflection.<span style="color: #003366;">Assembly</span><span style="color: #333;">&#93;</span></span>::<span style="color: #003366;">LoadWithPartialName</span><span style="color: #333;">&#40;</span><span style="color: #009900;">&quot;System.Web&quot;</span><span style="color: #333;">&#41;</span><br />
&nbsp; &nbsp;<span style="color: #003366; font-weight: bold;"><span style="color: #333;">&#91;</span><span style="color: #003366; font-weight: bold;">string</span><span style="color: #333;">&#93;</span></span><span style="color: #660033; font-weight: bold;">$data</span> <span style="color: #66cc66;">=</span> <span style="color: #660033; font-weight: bold;">$null</span>;<br />
&nbsp; &nbsp;<span style="color: #003366; font-weight: bold;"><span style="color: #333;">&#91;</span><span style="color: #003366; font-weight: bold;">string</span><span style="color: #333;">&#93;</span></span><span style="color: #660033; font-weight: bold;">$meta</span> <span style="color: #66cc66;">=</span> <span style="color: #660033; font-weight: bold;">$null</span>;<br />
<br />
&nbsp; &nbsp;<span style="color: #666699; font-weight: bold;">if</span><span style="color: #333;">&#40;</span><span style="color: #660033; font-weight: bold;">$language</span><span style="color: #333;">&#41;</span> <span style="color: #333;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #660033; font-weight: bold;">$meta</span> <span style="color: #66cc66;">=</span> <span style="color: #009900;">&quot;format=&quot;</span> <span style="color: #66cc66;">+</span> <span style="color: #003366; font-weight: bold;"><span style="color: #333;">&#91;</span>System.<span style="color: #003366;">Web</span>.<span style="color: #003366;">HttpUtility</span><span style="color: #333;">&#93;</span></span>::<span style="color: #003366;">UrlEncode</span><span style="color: #333;">&#40;</span><span style="color: #660033; font-weight: bold;">$language</span><span style="color: #333;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;"># $url = $url + &quot;?&quot; +$lang</span><br />
&nbsp; &nbsp;<span style="color: #333;">&#125;</span> <span style="color: #666699; font-weight: bold;">else</span> <span style="color: #333;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #660033; font-weight: bold;">$meta</span> <span style="color: #66cc66;">=</span> <span style="color: #009900;">&quot;format=text&quot;</span><br />
&nbsp; &nbsp;<span style="color: #333;">&#125;</span><br />
&nbsp; <br />
&nbsp; &nbsp;<span style="color: #666699; font-weight: bold;">do</span> <span style="color: #333;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #666699; font-weight: bold;">switch</span> <span style="color: #000066;">-regex</span> <span style="color: #333;">&#40;</span><span style="color: #660033; font-weight: bold;">$KeepFor</span><span style="color: #333;">&#41;</span> <span style="color: #333;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #009900;">&quot;^d.*&quot;</span> <span style="color: #333;">&#123;</span> <span style="color: #660033; font-weight: bold;">$meta</span> <span style="color: #66cc66;">+=</span> <span style="color: #009900;">&quot;&amp;amp;amp;expiry=d&quot;</span> <span style="color: #333;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #009900;">&quot;^m.*&quot;</span> <span style="color: #333;">&#123;</span> <span style="color: #660033; font-weight: bold;">$meta</span> <span style="color: #66cc66;">+=</span> <span style="color: #009900;">&quot;&amp;amp;amp;expiry=m&quot;</span> <span style="color: #333;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #009900;">&quot;^f.*&quot;</span> <span style="color: #333;">&#123;</span> <span style="color: #660033; font-weight: bold;">$meta</span> <span style="color: #66cc66;">+=</span> <span style="color: #009900;">&quot;&amp;amp;amp;expiry=f&quot;</span> <span style="color: #333;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;default <span style="color: #333;">&#123;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #660033; font-weight: bold;">$KeepFor</span> <span style="color: #66cc66;">=</span> <span style="color: #0066cc; font-style: italic;">Read-<span style="font-style: normal;">Host</span></span> <span style="color: #009900;">&quot;Invalid value for 'KeepFor' parameter. Please specify 'day', 'month', or 'forever'&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #333;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #333;">&#125;</span><br />
&nbsp; &nbsp;<span style="color: #333;">&#125;</span> <span style="color: #666699; font-weight: bold;">until</span> <span style="color: #333;">&#40;</span> <span style="color: #660033; font-weight: bold;">$meta</span> <span style="color: #000066;">-like</span> <span style="color: #009900;">&quot;*&amp;amp;amp;expiry*&quot;</span> <span style="color: #333;">&#41;</span><br />
<br />
&nbsp; &nbsp;<span style="color: #666699; font-weight: bold;">if</span><span style="color: #333;">&#40;</span><span style="color: #660033; font-weight: bold;">$Description</span><span style="color: #333;">&#41;</span> <span style="color: #333;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #660033; font-weight: bold;">$meta</span> <span style="color: #66cc66;">+=</span> <span style="color: #009900;">&quot;&amp;amp;amp;descrip=&quot;</span> <span style="color: #66cc66;">+</span> <span style="color: #003366; font-weight: bold;"><span style="color: #333;">&#91;</span>System.<span style="color: #003366;">Web</span>.<span style="color: #003366;">HttpUtility</span><span style="color: #333;">&#93;</span></span>::<span style="color: #003366;">UrlEncode</span><span style="color: #333;">&#40;</span><span style="color: #660033; font-weight: bold;">$Description</span><span style="color: #333;">&#41;</span><br />
&nbsp; &nbsp;<span style="color: #333;">&#125;</span> <span style="color: #666699; font-weight: bold;">else</span> <span style="color: #333;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #660033; font-weight: bold;">$meta</span> <span style="color: #66cc66;">+=</span> <span style="color: #009900;">&quot;&amp;amp;amp;descrip=&quot;</span><br />
&nbsp; &nbsp;<span style="color: #333;">&#125;</span> &nbsp; <br />
&nbsp; &nbsp;<span style="color: #660033; font-weight: bold;">$meta</span> <span style="color: #66cc66;">+=</span> <span style="color: #009900;">&quot;&amp;amp;amp;poster=&quot;</span> <span style="color: #66cc66;">+</span> <span style="color: #003366; font-weight: bold;"><span style="color: #333;">&#91;</span>System.<span style="color: #003366;">Web</span>.<span style="color: #003366;">HttpUtility</span><span style="color: #333;">&#93;</span></span>::<span style="color: #003366;">UrlEncode</span><span style="color: #333;">&#40;</span><span style="color: #660033; font-weight: bold;">$Author</span><span style="color: #333;">&#41;</span><br />
&nbsp; &nbsp;<br />
&nbsp; &nbsp;<span style="color: #666699; font-weight: bold;">function</span> PasteBin<span style="color: #66cc66;">-</span>Text <span style="color: #333;">&#40;</span><span style="color: #660033; font-weight: bold;">$meta</span>, <span style="color: #660033; font-weight: bold;">$title</span>, <span style="color: #660033; font-weight: bold;">$data</span><span style="color: #333;">&#41;</span> <span style="color: #333;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #660033; font-weight: bold;">$meta</span> <span style="color: #66cc66;">+=</span> <span style="color: #009900;">&quot;&amp;amp;amp;paste=Send&amp;amp;amp;posttitle=&quot;</span> <span style="color: #66cc66;">+</span> <span style="color: #003366; font-weight: bold;"><span style="color: #333;">&#91;</span>System.<span style="color: #003366;">Web</span>.<span style="color: #003366;">HttpUtility</span><span style="color: #333;">&#93;</span></span>::<span style="color: #003366;">UrlEncode</span><span style="color: #333;">&#40;</span><span style="color: #660033; font-weight: bold;">$Title</span><span style="color: #333;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #660033; font-weight: bold;">$data</span> <span style="color: #66cc66;">=</span> <span style="color: #660033; font-weight: bold;">$meta</span> <span style="color: #66cc66;">+</span> <span style="color: #009900;">&quot;&amp;amp;amp;code2=&quot;</span> <span style="color: #66cc66;">+</span> <span style="color: #003366; font-weight: bold;"><span style="color: #333;">&#91;</span>System.<span style="color: #003366;">Web</span>.<span style="color: #003366;">HttpUtility</span><span style="color: #333;">&#93;</span></span>::<span style="color: #003366;">UrlEncode</span><span style="color: #333;">&#40;</span><span style="color: #660033; font-weight: bold;">$data</span><span style="color: #333;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;"># Write-Host $data -fore yellow</span><br />
&nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; <span style="color: #660033; font-weight: bold;">$request</span> <span style="color: #66cc66;">=</span> <span style="color: #003366; font-weight: bold;"><span style="color: #333;">&#91;</span>System.<span style="color: #003366;">Net</span>.<span style="color: #003366;">WebRequest</span><span style="color: #333;">&#93;</span></span>::<span style="color: #003366;">Create</span><span style="color: #333;">&#40;</span><span style="color: #660033; font-weight: bold;">$url</span><span style="color: #333;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #660033; font-weight: bold;">$request</span>.<span style="color: #003366;">ContentType</span> <span style="color: #66cc66;">=</span> <span style="color: #009900;">&quot;application/x-www-form-urlencoded&quot;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #660033; font-weight: bold;">$request</span>.<span style="color: #003366;">ContentLength</span> <span style="color: #66cc66;">=</span> <span style="color: #660033; font-weight: bold;">$data</span>.<span style="color: #003366;">Length</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #660033; font-weight: bold;">$request</span>.<span style="color: #003366;">Method</span> <span style="color: #66cc66;">=</span> <span style="color: #009900;">&quot;POST&quot;</span><br />
<br />
&nbsp; &nbsp; &nbsp; <span style="color: #660033; font-weight: bold;">$post</span> <span style="color: #66cc66;">=</span> <span style="color: #0066cc; font-style: italic;">new-<span style="font-style: normal;">object</span></span> IO.<span style="color: #003366;">StreamWriter</span> <span style="color: #660033; font-weight: bold;">$request</span>.<span style="color: #003366;">GetRequestStream</span><span style="color: #333;">&#40;</span><span style="color: #333;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #660033; font-weight: bold;">$post</span>.<span style="color: #660033;">Write</span><span style="color: #333;">&#40;</span><span style="color: #660033; font-weight: bold;">$data</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #660033; font-weight: bold;">$data</span>.<span style="color: #003366;">Length</span><span style="color: #333;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #660033; font-weight: bold;">$post</span>.<span style="color: #003366;">Flush</span><span style="color: #333;">&#40;</span><span style="color: #333;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #660033; font-weight: bold;">$post</span>.<span style="color: #003366;">Close</span><span style="color: #333;">&#40;</span><span style="color: #333;">&#41;</span><br />
<br />
&nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;"># $reader = new-object IO.StreamReader $request.GetResponse().GetResponseStream() ##,[Text.Encoding]::UTF8</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;"># write-output $reader.ReadToEnd()</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;"># $reader.Close()</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #0066cc; font-style: italic;">write-<span style="font-style: normal;">output</span></span> <span style="color: #660033; font-weight: bold;">$request</span>.<span style="color: #003366;">GetResponse</span><span style="color: #333;">&#40;</span><span style="color: #333;">&#41;</span>.<span style="color: #003366;">ResponseUri</span>.<span style="color: #003366;">AbsoluteUri</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #660033; font-weight: bold;">$request</span>.<span style="color: #003366;">Abort</span><span style="color: #333;">&#40;</span><span style="color: #333;">&#41;</span> &nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp;<span style="color: #333;">&#125;</span><br />
<span style="color: #333;">&#125;</span><br />
<br />
<span style="color: #666699; font-weight: bold;">PROCESS</span> <span style="color: #333;">&#123;</span><br />
&nbsp; &nbsp;<span style="color: #666699; font-weight: bold;">switch</span><span style="color: #333;">&#40;</span><span style="color: #660033; font-weight: bold;">$_</span><span style="color: #333;">&#41;</span> <span style="color: #333;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #333;">&#123;</span><span style="color: #660033; font-weight: bold;">$_</span> <span style="color: #000066;">-is</span> <span style="color: #003366; font-weight: bold;"><span style="color: #333;">&#91;</span>System.<span style="color: #003366;">IO</span>.<span style="color: #003366;">FileInfo</span><span style="color: #333;">&#93;</span></span><span style="color: #333;">&#125;</span> <span style="color: #333;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #660033; font-weight: bold;">$Title</span> <span style="color: #66cc66;">=</span> <span style="color: #660033; font-weight: bold;">$_</span>.<span style="color: #003366;">Name</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0066cc; font-style: italic;">Write-<span style="font-style: normal;">Output</span></span> <span style="color: #660033; font-weight: bold;">$_</span>.<span style="color: #003366;">FullName</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0066cc; font-style: italic;">Write-<span style="font-style: normal;">Output</span></span> $<span style="color: #333;">&#40;</span>PasteBin<span style="color: #66cc66;">-</span>Text <span style="color: #660033; font-weight: bold;">$meta</span> <span style="color: #660033; font-weight: bold;">$Title</span> $<span style="color: #333;">&#40;</span><span style="color: #003366; font-weight: bold;"><span style="color: #333;">&#91;</span><span style="color: #003366; font-weight: bold;">string</span><span style="color: #333;">&#93;</span></span>::<span style="color: #333399; font-weight: bold; font-style: italic;">join</span><span style="color: #333;">&#40;</span><span style="color: #009900;">&quot;<span style="color: #000099; font-weight: bold;">`n</span>&quot;</span>,<span style="color: #333;">&#40;</span><span style="color: #0066cc; font-style: italic;">Get-<span style="font-style: normal;">Content</span></span> <span style="color: #660033; font-weight: bold;">$_</span>.<span style="color: #003366;">FullName</span><span style="color: #333;">&#41;</span><span style="color: #333;">&#41;</span><span style="color: #333;">&#41;</span><span style="color: #333;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #333;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #333;">&#123;</span><span style="color: #660033; font-weight: bold;">$_</span> <span style="color: #000066;">-is</span> <span style="color: #003366; font-weight: bold;"><span style="color: #333;">&#91;</span><span style="color: #003366; font-weight: bold;">String</span><span style="color: #333;">&#93;</span></span><span style="color: #333;">&#125;</span> <span style="color: #333;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #666699; font-weight: bold;">if</span><span style="color: #333;">&#40;</span><span style="color: #66cc66;">!</span><span style="color: #660033; font-weight: bold;">$data</span> <span style="color: #000066;">-and</span> <span style="color: #66cc66;">!</span><span style="color: #660033; font-weight: bold;">$Title</span><span style="color: #333;">&#41;</span><span style="color: #333;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #660033; font-weight: bold;">$Title</span> <span style="color: #66cc66;">=</span> <span style="color: #0066cc; font-style: italic;">Read-<span style="font-style: normal;">Host</span></span> <span style="color: #009900;">&quot;Give us a title for your post&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #333;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #660033; font-weight: bold;">$data</span> <span style="color: #66cc66;">+=</span> <span style="color: #009900;">&quot;<span style="color: #000099; font-weight: bold;">`n</span>&quot;</span> <span style="color: #66cc66;">+</span> <span style="color: #660033; font-weight: bold;">$_</span> <br />
&nbsp; &nbsp; &nbsp; <span style="color: #333;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">## Todo, handle folders?</span><br />
&nbsp; &nbsp; &nbsp; default <span style="color: #333;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0066cc; font-style: italic;">Write-<span style="font-style: normal;">Error</span></span> <span style="color: #009900;">&quot;Unable to process $_&quot;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #333;">&#125;</span><br />
&nbsp; &nbsp;<span style="color: #333;">&#125;</span><br />
<span style="color: #333;">&#125;</span><br />
<span style="color: #666699; font-weight: bold;">END</span> <span style="color: #333;">&#123;</span><br />
&nbsp; &nbsp;<span style="color: #666699; font-weight: bold;">if</span><span style="color: #333;">&#40;</span><span style="color: #660033; font-weight: bold;">$data</span><span style="color: #333;">&#41;</span> <span style="color: #333;">&#123;</span> <br />
&nbsp; &nbsp; &nbsp; <span style="color: #0066cc; font-style: italic;">Write-<span style="font-style: normal;">Output</span></span> $<span style="color: #333;">&#40;</span>PasteBin<span style="color: #66cc66;">-</span>Text <span style="color: #660033; font-weight: bold;">$meta</span> <span style="color: #660033; font-weight: bold;">$Title</span> <span style="color: #660033; font-weight: bold;">$data</span><span style="color: #333;">&#41;</span><br />
&nbsp; &nbsp;<span style="color: #333;">&#125;</span><br />
<span style="color: #333;">&#125;</span><br />
<span style="color: #666666; font-style: italic;">#}</span></div>

	<p>Incidentally, the matching &#8220;Receive-Paste&#8221; script is just a matter wrapping a call to my <a href="http://huddledmasses.org/wget-2-for-powershell/">wget for powershell</a> in a script that lets you put just the ID in, and builds a url like http://powershellcentral.com/scripts/?dl=172 (notice the <code>?dl=</code> part, that&#8217;s the important part) ...</p>]]></content:encoded>
			<wfw:commentRss>http://huddledmasses.org/powershell-send-paste-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

