PowerShell Team

Automating the world one-liner at a time…

Working with Sort-Object Cmdlet

In this blog I will try to explain different features of sort-object(Sort) cmdlet. For the purpose of this blog, I assume the following objects exist:   MSH C:\temp\monad> $a,$b,$c,$d                           &...

Is it safe to use ALIASES in scripts?

In our newsgroup (Microsoft.Public.Windows.Server.Scripting) , Mark Ayers asked the question:> Shouldn't best practice for scripts be full command name? The answer is YES, NO, and MAYBE. YES - Full names provide the most readable experience for scripts.  This is very important.  People often throw the rock at Perl saying...

Verb-Noun vs Noun-Verb

Kurt asked the question "why not Noun-Verb vs Verb-Noun" in his post: http://blogs.msdn.com/monad/archive/2006/02/16/533522.aspx#574708 There are lots of answers to this some better than others.  Let me rattle off a couple of them: Jeffrey P. SnoverMonad Architect [Edit: Monad has now been renamed to Windows PowerShell. This script or ...

Comparative Examples in MSH and KSH

  Most shells (such as Windows CMD.EXE and the UNIX shells SH, KSH, CSH, and BASH) operate by executing a command or utility in a new process, and presenting the results (or errors) to the user as text. Text-based processing is the way in which system interaction is done with these shells. Over the years, a large number of text ...

A bit about Scriptblocks

When scripting with MSH one of the most useful things to know about are scriptblocks (lambda functions).  Scriptblocks are compiled bits of MSH script which you can pass around and invoke whenever you feel like it.  They turn out to be so useful that if you look at the cmdlets you’ll find a few that take scriptblocks (foreach-...

Monad portal in Script Center.

Most scripters are familar with Microsoft script center.  Script center now has a portal for Microsoft Command Shell.  You can access the portal at http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx -Arul Kumaravel [Edit: Monad has now been renamed to Windows PowerShell. This script or discussion may require slight ...

PINVOKE or accessing WIN32 APIs

In the very early days of Monad, we focused on a world where everyone would publish Cmdlets and providers.  Cmdlets and providers were designed around providing the best user experience.  They provide the right, high-level, task-oriented abstractions that users want while also providing the semantic benefits that ...