<?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>Dejan on Technology &#187; PowerShell</title>
	<atom:link href="http://www.vesic.org/english/blog/category/powershell/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.vesic.org/english/blog</link>
	<description>dotNet, ASP.Net, Programming, Software ...</description>
	<lastBuildDate>Mon, 01 Mar 2010 09:07:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Scripting Man&#8217;s best friend &#8211; PowerShell</title>
		<link>http://www.vesic.org/english/blog/net/windows-powershell/</link>
		<comments>http://www.vesic.org/english/blog/net/windows-powershell/#comments</comments>
		<pubDate>Thu, 16 Nov 2006 13:06:36 +0000</pubDate>
		<dc:creator>Dejan Vesić</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Scripting]]></category>

		<guid isPermaLink="false">http://www.vesic.org/english/blog/net/windows-powershell/</guid>
		<description><![CDATA[In the world of GUI, at the heart, I am still scripting / command line / shell man. No matter how GUI application is built, there can be no efficiency and repeatability like in a powerful, versatile script. 

In the beginning, there was DOS ...]]></description>
			<content:encoded><![CDATA[<p>In the world of GUI, at the heart, I am still scripting / command line / shell man.</p>
<p>No matter how GUI application is built, there can be no efficiency and repeatability like in a powerful, versatile script. </p>
<p>In the beginning, there was DOS. Than simple <em>Command </em>processor of Windows 95/98 (I resisted of installing Windows ME, thank God for that). Than, enlightenment &#8211; <a href="http://www.jpsoft.com/">JP</a>&#8216;s <strong>4Dos</strong> (retired) and <a href="http://www.jpsoft.com/4ntdes.htm"><strong>4NT</strong></a> &#8211; the way CMD should be from start. 4NT was breakthrough in my productivity &#8211; backup, maintenance, monitor scripts; processing of folders and files; automating each and every boring repeatable action. Add on top of that <a href="http://en.wikipedia.org/wiki/Awk">AWK</a> for really complicated stuff and there was no problem without solution.</p>
<p>Microsoft was aware about all of shortcomings of CMD shell and tried to overcome them introducing <a href="http://en.wikipedia.org/wiki/Windows_Script_Host">Windows Scripting Shell</a>; however, that approach simply was not successful.</p>
<p>Than MS started to work on <em>Microsoft Shell </em>or <em>MSH</em> (codenamed <strong>Monad</strong>), and first public  beta was in September 2005. Finally, they renamed it to <strong>Windows PowerShell</strong> and build one of the most powerful scripting system for all kinds of tasks &#8211; from simple file operations to management of domains and networks. With PowerShell you can manage files, folders, remote locations, registry items, COM objects &#8230; </p>
<p>Let&#8217;s see how <em>dir</em> command does both in PS and CMD:</p>
<p><img src="http://www.vesic.org/blog/upload/power-shell-dir.png" alt="PowerShell dir command" /></p>
<p>What is the difference? (apart from obvious: colors and different way of displaying information) Real difference is that result of the <em>CMD dir</em> command are lines of text and result of <em>PS dir</em> command are objects; objects which you can query for attributes and to decide what to do next based on attribute values.</p>
<ul>
<li>Commands are not text-based &#8211; they deal with objects</li>
<li>Command family is extensible &#8211; native binary commands, cmdlets (pronounced command-lets) can be augmented by cmdlets that you create</li>
</ul>
<p>For example, to find out all properties of objects returned with dir, execute:<br />
<code> dir | get-member</code></p>
<p>By the way, <em>dir</em> is not real name for cmdlet &#8211; it is just an <em>alias</em>:</p>
<p><img src="http://www.vesic.org/blog/upload/power-shell-alias.png" alt="PowerShell Get-Alias dir" /></p>
<p>You can create your own aliases using the <em>Set-Alias</em> cmdlet.  </p>
<p>Just one important thing if you plan to dive into PowerShell scripts world:</p>
<blockquote><p>In order to create and use scripts, instead of just inline commands, you need to deal with security. More info can be obtained with<br />
* <code>get-help about_signing | more</code><br />
* <code>get-help Set-AuthenticodeSignature -detailed | more</code></p>
<p>(or redirect this to file and read afterwards)
</p></blockquote>
<p>(basic help can be obtained for any cmdlet with &#8220;<em>-?</em>&#8220;; detailed help can be obtained with &#8220;<em>get-help cmdlet-name</em>&#8220;)</p>
<p>Almost forgot &#8211; real reason for this post was that <a href="http://blogs.msdn.com/powershell/archive/2006/11/15/no-really-powershell-v1-0-is-released.aspx">PowerShell reached version 1.0 and it is availabile for download</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.vesic.org/english/blog/net/windows-powershell/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

