<?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>SearchMarked.com &#187; Powershell</title>
	<atom:link href="http://www.searchmarked.com/category/powershell/feed" rel="self" type="application/rss+xml" />
	<link>http://www.searchmarked.com</link>
	<description>I search, I bookmark, I write, You learn.</description>
	<lastBuildDate>Wed, 14 Oct 2009 12:56:26 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>How to deal with long filenames in Windows Powershell</title>
		<link>http://www.searchmarked.com/windows/how-to-deal-with-long-filenames-in-windows-powershell.php</link>
		<comments>http://www.searchmarked.com/windows/how-to-deal-with-long-filenames-in-windows-powershell.php#comments</comments>
		<pubDate>Fri, 14 Dec 2007 16:21:34 +0000</pubDate>
		<dc:creator>hstagner</dc:creator>
				<category><![CDATA[Powershell]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.searchmarked.com/windows/how-to-deal-with-long-filenames-in-windows-powershell.php</guid>
		<description><![CDATA[Google Query: long filename and powershell 
I was working on a project the other day where I had to call a program from within Windows Powershell. This particular program needed command-line arguments and an input file when it was called. I wasn&#8217;t sure about the syntax of doing this in Powershell. After some Googling, I found [...]<script type="text/javascript">SHARETHIS.addEntry({ title: "How to deal with long filenames in Windows Powershell", url: "http://www.searchmarked.com/windows/how-to-deal-with-long-filenames-in-windows-powershell.php" });</script>


No related posts.

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p><strong>Google Query: long filename and powershell </strong></p>
<p>I was working on a project the other day where I had to call a program from within Windows Powershell. This particular program needed command-line arguments and an input file when it was called. I wasn&#8217;t sure about the syntax of doing this in Powershell. After some Googling, I found the answer on the <a href="http://channel9.msdn.com/ShowPost.aspx?PostID=236648" onclick="javascript:urchinTracker ('/outbound/article/channel9.msdn.com');">Microsoft Channel 9 Forums</a>. The details are below.</p>
<p>-If you want to call a long filename in your Powershell script, the line looks similar to the one below (all on one line).<br />
<code>&amp;'<em>C:\Path\To\Your\Program.exe</em>' <em>-argument1 -argument2</em> '<em>C:\Path\To\Your\Inputfile.txt</em>'</code></p>
<p>That&#8217;s it! Once I got the proper syntax, my Powershell script ran my external program beautifully. Happy Coding!</p>
<p>Technorati Tags: <a href="http://technorati.com/tag/Windows" rel="tag" onclick="javascript:urchinTracker ('/outbound/article/technorati.com');">Windows</a>, <a href="http://technorati.com/tag/Powershell" rel="tag" onclick="javascript:urchinTracker ('/outbound/article/technorati.com');"> Powershell</a>, <a href="http://technorati.com/tag/Programming" rel="tag" onclick="javascript:urchinTracker ('/outbound/article/technorati.com');"> Programming</a>, <a href="http://technorati.com/tag/Scripting" rel="tag" onclick="javascript:urchinTracker ('/outbound/article/technorati.com');"> Scripting</a></p>
<p><a href="http://sharethis.com/item?&wp=2.8.6&amp;publisher=2b863fb9-6985-4119-9ea7-b8a518a3714e&amp;title=How+to+deal+with+long+filenames+in+Windows+Powershell&amp;url=http%3A%2F%2Fwww.searchmarked.com%2Fwindows%2Fhow-to-deal-with-long-filenames-in-windows-powershell.php" onclick="javascript:urchinTracker ('/outbound/article/sharethis.com');">ShareThis</a></p>

<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.searchmarked.com/windows/how-to-deal-with-long-filenames-in-windows-powershell.php/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to put line breaks into a text string in Windows Powershell</title>
		<link>http://www.searchmarked.com/windows/how-to-put-line-breaks-into-a-text-string-in-windows-powershell.php</link>
		<comments>http://www.searchmarked.com/windows/how-to-put-line-breaks-into-a-text-string-in-windows-powershell.php#comments</comments>
		<pubDate>Tue, 11 Dec 2007 01:12:28 +0000</pubDate>
		<dc:creator>hstagner</dc:creator>
				<category><![CDATA[Powershell]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.searchmarked.com/windows/how-to-put-line-breaks-into-a-text-string-in-windows-powershell.php</guid>
		<description><![CDATA[Google Query: line breaks in powershell
In a particular Powershell project I was working on, I needed to &#8220;Send an email using Windows Powershell.&#8221; I figured out how to do that, so the next trick was formatting the body of the email to look like more than just one long sentence.
In VBScript you would do this [...]<script type="text/javascript">SHARETHIS.addEntry({ title: "How to put line breaks into a text string in Windows Powershell", url: "http://www.searchmarked.com/windows/how-to-put-line-breaks-into-a-text-string-in-windows-powershell.php" });</script>


No related posts.

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p><strong>Google Query: line breaks in powershell</strong></p>
<p>In a particular Powershell project I was working on, I needed to &#8220;<a href="http://www.searchmarked.com/windows/how-to-send-an-email-using-a-windows-powershell-script.php" >Send an email using Windows Powershell</a>.&#8221; I figured out how to do that, so the next trick was formatting the body of the email to look like more than just one long sentence.</p>
<p>In VBScript you would do this with VBcrlf (carriage return, line feed) and non-breaking spaces until you were satisfied with the text formatting. I was looking for something similar in Windows Powershell until I discovered that Powershell offers a more elegant solution. I found a little gem called a &#8220;here-string&#8221; at the <a href="http://www.microsoft.com/technet/scriptcenter/resources/pstips/jun07/pstip0629.mspx" onclick="javascript:urchinTracker ('/outbound/article/www.microsoft.com');">Technet Script Center</a>. The summary of this feature is below.</p>
<p>A &#8220;here-string&#8221; is basically a WYSIWYG (What You See Is What You Get) text string that you can assign to a variable. You begin the string by initiating it like the example below.<br />
<code>$MyVariable = @"</code></p>
<p>Now anything following this will be formatted like you type it.  For example:</p>
<p><code>$MyVariable = @"<br />
"I will be formatted with<br />
odd<br />
line<br />
breaks<br />
without<br />
a single<br />
line of line-break<br />
code!<br />
"<br />
"@</code></p>
<p>As you can see you end the &#8220;here-string&#8221; like so:<br />
<code>"@</code><br />
on a line by itself.</p>
<p>So what will the output of this variable be? Anything in between the top and bottom of the &#8220;here-string&#8221; block will be formatted as you typed it. See below:<br />
<code>"I will be formatted with<br />
odd<br />
line<br />
breaks<br />
without<br />
a single<br />
line of line-break<br />
code!<br />
"</code></p>
<p>It&#8217;s magic! The more I use Powershell, the more I love it! It&#8217;s efficient and elegant. A potent combination. Happy Coding!</p>
<p>Technorati Tags: <a href="http://technorati.com/tag/Windows" rel="tag" onclick="javascript:urchinTracker ('/outbound/article/technorati.com');">Windows</a>, <a href="http://technorati.com/tag/Powershell" rel="tag" onclick="javascript:urchinTracker ('/outbound/article/technorati.com');"> Powershell</a>, <a href="http://technorati.com/tag/Programming" rel="tag" onclick="javascript:urchinTracker ('/outbound/article/technorati.com');"> Programming</a>, <a href="http://technorati.com/tag/Scripting" rel="tag" onclick="javascript:urchinTracker ('/outbound/article/technorati.com');"> Scripting</a></p>
<p><a href="http://sharethis.com/item?&wp=2.8.6&amp;publisher=2b863fb9-6985-4119-9ea7-b8a518a3714e&amp;title=How+to+put+line+breaks+into+a+text+string+in+Windows+Powershell&amp;url=http%3A%2F%2Fwww.searchmarked.com%2Fwindows%2Fhow-to-put-line-breaks-into-a-text-string-in-windows-powershell.php" onclick="javascript:urchinTracker ('/outbound/article/sharethis.com');">ShareThis</a></p>

<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.searchmarked.com/windows/how-to-put-line-breaks-into-a-text-string-in-windows-powershell.php/feed</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>How to send an email using a Windows Powershell script</title>
		<link>http://www.searchmarked.com/windows/how-to-send-an-email-using-a-windows-powershell-script.php</link>
		<comments>http://www.searchmarked.com/windows/how-to-send-an-email-using-a-windows-powershell-script.php#comments</comments>
		<pubDate>Wed, 05 Dec 2007 17:26:40 +0000</pubDate>
		<dc:creator>hstagner</dc:creator>
				<category><![CDATA[Powershell]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.searchmarked.com/windows/how-to-send-an-email-using-a-windows-powershell-script.php</guid>
		<description><![CDATA[
// 

Your Ad Here

Google Query: send email with powershell
In a previous post, I showed you how you can schedule a Powershell script. In this post I show you how to use Powershell to send an email. Thanks to Otto Helweg for the inspiration. This might be useful if you would like an email sent confirming [...]<script type="text/javascript">SHARETHIS.addEntry({ title: "How to send an email using a Windows Powershell script", url: "http://www.searchmarked.com/windows/how-to-send-an-email-using-a-windows-powershell-script.php" });</script>


No related posts.

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<div style="float: left;"><!-- Begin: AdBrite --><br />
<script type="text/javascript">// <![CDATA[
   var AdBrite_Title_Color = 'FFFFFF';
   var AdBrite_Text_Color = '000000';
   var AdBrite_Background_Color = '000000';
   var AdBrite_Border_Color = '2D8930';
   var AdBrite_URL_Color = '008000';
// ]]&gt;</script><br />
<script src="http://ads.adbrite.com/mb/text_group.php?sid=745476&amp;zs=3330305f323530" type="text/javascript"></script></div>
<div><a href="http://www.adbrite.com/mb/commerce/purchase_form.php?opid=745476&amp;afsid=1"style="font-weight:bold;font-family:Arial;font-size:13px;"  target="_top" onclick="javascript:urchinTracker ('/outbound/article/www.adbrite.com');">Your Ad Here</a></div>
<p><!-- End: AdBrite --></p>
<p><strong>Google Query: send email with powershell</strong></p>
<p>In a previous post, I showed you how you can schedule a Powershell script. In this post I show you how to use Powershell to send an email. Thanks to <a href="http://blogs.technet.com/otto/archive/2007/08/23/quick-and-dirty-web-site-monitoring-with-powershell.aspx" onclick="javascript:urchinTracker ('/outbound/article/blogs.technet.com');">Otto Helweg</a> for the inspiration. This might be useful if you would like an email sent confirming that a script ran successfully.</p>
<p>This can be accomplished by using the Net.Mail.SmtpClient object. The syntax of the Powershell code needed is below:</p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p><code>$emailFrom = "user@yourdomain.com"<br />
$emailTo = "user@yourdomain.com"<br />
$subject = "your subject"<br />
$body = "your body"<br />
$smtpServer = "your smtp server"<br />
$smtp = new-object Net.Mail.SmtpClient($smtpServer)<br />
$smtp.Send($emailFrom, $emailTo, $subject, $body)</code></p>
<p>That&#8217;s it. Put this code (filling in your appropriate information) at the end of your Powershell script to send an email after the rest of the script finishes processing. If you use this code snippet in any of your projects please feel free to let me know in the comments.</p>
<p>Happy Coding!</p>
<p>Technorati Tags: <a href="http://technorati.com/tag/Windows" rel="tag" onclick="javascript:urchinTracker ('/outbound/article/technorati.com');">Windows</a>, <a href="http://technorati.com/tag/Powershell" rel="tag" onclick="javascript:urchinTracker ('/outbound/article/technorati.com');"> Powershell</a>, <a href="http://technorati.com/tag/Scripting" rel="tag" onclick="javascript:urchinTracker ('/outbound/article/technorati.com');"> Scripting</a>, <a href="http://technorati.com/tag/Programming" rel="tag" onclick="javascript:urchinTracker ('/outbound/article/technorati.com');"> Programming</a></p>
<p><a href="http://sharethis.com/item?&wp=2.8.6&amp;publisher=2b863fb9-6985-4119-9ea7-b8a518a3714e&amp;title=How+to+send+an+email+using+a+Windows+Powershell+script&amp;url=http%3A%2F%2Fwww.searchmarked.com%2Fwindows%2Fhow-to-send-an-email-using-a-windows-powershell-script.php" onclick="javascript:urchinTracker ('/outbound/article/sharethis.com');">ShareThis</a></p>

<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.searchmarked.com/windows/how-to-send-an-email-using-a-windows-powershell-script.php/feed</wfw:commentRss>
		<slash:comments>29</slash:comments>
		</item>
		<item>
		<title>How to schedule a Windows Powershell script</title>
		<link>http://www.searchmarked.com/windows/how-to-schedule-a-windows-powershell-script.php</link>
		<comments>http://www.searchmarked.com/windows/how-to-schedule-a-windows-powershell-script.php#comments</comments>
		<pubDate>Tue, 04 Dec 2007 03:03:15 +0000</pubDate>
		<dc:creator>hstagner</dc:creator>
				<category><![CDATA[Powershell]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.searchmarked.com/windows/how-to-schedule-a-windows-powershell-script.php</guid>
		<description><![CDATA[

   var AdBrite_Title_Color = 'FFFFFF';
   var AdBrite_Text_Color = '000000';
   var AdBrite_Background_Color = '000000';
   var AdBrite_Border_Color = '2D8930';
   var AdBrite_URL_Color = '008000';


Your Ad Here

Google Query: schedule a powershell script
I was recently working on a project where I needed to schedule a Windows Powershell script to run. [...]<script type="text/javascript">SHARETHIS.addEntry({ title: "How to schedule a Windows Powershell script", url: "http://www.searchmarked.com/windows/how-to-schedule-a-windows-powershell-script.php" });</script>


No related posts.

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<div style="float: left;"><!-- Begin: AdBrite --><br />
<script type="text/javascript">
   var AdBrite_Title_Color = 'FFFFFF';
   var AdBrite_Text_Color = '000000';
   var AdBrite_Background_Color = '000000';
   var AdBrite_Border_Color = '2D8930';
   var AdBrite_URL_Color = '008000';
</script><br />
<script src="http://ads.adbrite.com/mb/text_group.php?sid=745476&#038;zs=3330305f323530" type="text/javascript"></script></p>
<div><a href="http://www.adbrite.com/mb/commerce/purchase_form.php?opid=745476&#038;afsid=1"target="_top"  style="font-weight:bold;font-family:Arial;font-size:13px;" onclick="javascript:urchinTracker ('/outbound/article/www.adbrite.com');">Your Ad Here</a></div>
<p><!-- End: AdBrite --></div>
<p><strong>Google Query: schedule a powershell script</strong></p>
<p>I was recently working on a project where I needed to schedule a Windows Powershell script to run. After some searching, I came across a post that lead me in the right direction at <a href="http://mutable.net/blog/archive/2006/10/05/PowerTips-for-PowerShell.aspx" onclick="javascript:urchinTracker ('/outbound/article/mutable.net');">Mutable.net</a>. Here is how you can schedule a Windows Powershell Script:</p>
<p>The first thing you need to do is make sure that Powershell is set to execute Powershell scripts, instead of only allowing interactive commands to be run in the Powershell environment.</p>
<p>Type the following at the Powershell command prompt:</p>
<div>
<p><code>set-executionpolicy RemoteSigned</code></p>
<p>This will allow the system to run Powershell scripts that are created locally (Remote Powershell scripts that may be downloaded must be signed).</p>
<p>Once this is done, you can create your Powershell script using notepad. Just make sure you name the file with an extension of .ps1 . Now to run the script outside of its Powershell environment you type a command similar to the following:<br />
<code>powershell -command "&amp; 'MyScript.ps1' "</code></p>
<p>Just put the above command into a .bat or .cmd file and schedule it like you would normally schedule a script to be run with Windows task scheduler. Happy coding!</p>
<p>Technorati Tags: <a href="http://technorati.com/tag/Windows" rel="tag" onclick="javascript:urchinTracker ('/outbound/article/technorati.com');">Windows</a>, <a href="http://technorati.com/tag/Powershell" rel="tag" onclick="javascript:urchinTracker ('/outbound/article/technorati.com');"> Powershell</a>, <a href="http://technorati.com/tag/Scripting" rel="tag" onclick="javascript:urchinTracker ('/outbound/article/technorati.com');"> Scripting</a></p>
<p><a href="http://sharethis.com/item?&wp=2.8.6&amp;publisher=2b863fb9-6985-4119-9ea7-b8a518a3714e&amp;title=How+to+schedule+a+Windows+Powershell+script&amp;url=http%3A%2F%2Fwww.searchmarked.com%2Fwindows%2Fhow-to-schedule-a-windows-powershell-script.php" onclick="javascript:urchinTracker ('/outbound/article/sharethis.com');">ShareThis</a></p>

<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.searchmarked.com/windows/how-to-schedule-a-windows-powershell-script.php/feed</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
	</channel>
</rss>
