Science Fair Project Encyclopedia
MSH, aka Microsoft Shell, is a command line interface and scripting language being developed by Microsoft as part of their next operating system, codenamed Windows Longhorn. It is similar in usage to the more advanced Unix shells, but, like most of Longhorn, is based on object-oriented programming and the .NET framework. MSH is also referred to by the codename Monad. Occasionally this shell is called WSH, in spite of the prior use of that name for the scripting technology called Windows Scripting Host.
Microsoft's first operating system was the text-based MS-DOS, which included a simple interface called command.com. Although certain features of this - and its successor under Windows NT, cmd.exe - were based on those of Unix shells, the latter are far more powerful. Indeed, as Windows was developed, more effort was put into providing graphical access to DOS features than vice versa, making many features of the OS awkward to interact with at the text-based level. This in turn led to some tasks being difficult to automate, as there was no scripting language immediately available to the user to automate everyday tasks.
This contrasted with the traditional Unix approach, based on the philosophy of pipes and filters, where many tools were designed to have inputs and outputs as text, which could be fed from one to another via pipes. MSH aims to not only catch up with this approach, but take it one step further by taking advantage of the development of object-oriented design.
The system's codename comes from Gottfried Leibniz's "Monadology", a philosophy which says that everything is a composition of fundamental elements called 'Monads', which are all integrated together in 'pre-established harmony'. Similarly, the focus of MSH is on composition of complex tasks from a series of components. In this case, the components are special programs called commandlets (or cmdlets), which are .NET classes designed to use the features of the environment. The key difference between the Unix approach and the MSH one is that rather than creating a "pipeline" based on textual input and output, MSH passes data between the various commandlets as arbitrary objects.
If accessed individually from the command-line, a commandlet's output will automatically be converted into text, but if its output is to be used by another commandlet, it will be converted into whatever form of object is most appropriate for that commandlet's input. This has the advantage of eliminating the need for the many text-processing utilities which are common in Unix pipelines, such as grep and awk, as well as allowing things to be combined interactively, or in a scripting environment, which would otherwise require a more complex programming language. For instance, a listing of processes will consist not of text describing them, but objects representing them, so that methods can be called on those objects without explicit reference to any outside structure or library.
MSH is part of an overall strategy within Longhorn to treat all parts of the OS as .NET objects, and thus allow the user greater flexibility over how they are used. This is aimed to make previously complex interactions manageable within the bounds of frameworks such as MSH; for example, Longhorn's registry can be exported as though it were a filesystem, and navigated by treating it as a hierarchy of files and directories.
Although still in development, a number of key features of MSH have already been revealed, including:
- commandlets all inherit certain options, allowing the user to choose things such as the level of interaction and how to deal with errors - including a "suspend" feature, which allows the user to enter a new command shell, investigate a problem, and then continue with the original command. A simple mechanism is built-in for the programmer to define the prompts to be shown in such circumstances.
- options are generally whole words, but can be specified to the minimum number of letters necessarily (e.g. the option
-show-detailed-informationcould be entered as
-sif no other option began with 's')
- tab completion
- the ability to assign the output of a command to a variable, which will then be an object or array of objects inspectable in any way desired. For example you can output a command result directly to Excel.
- The .NET Show - a Microsoft video discussing various aspects of .NET and Longhorn. Search for "Jeffrey Snover" in the transcript for the discussion of MSH/Monad
- Future Windows component could spur old-school script viruses - Monad's role in future security concerns, by Paul Roberts, IDG News Service]
- A list of links to blog entries related to MSH/Monad
The contents of this article is licensed from www.wikipedia.org under the GNU Free Documentation License. Click here to see the transparent copy and copyright details