Windows "Monad" Shell Beta 2 (for .NET Framework 2.0 RC/RTM) Release Notes

Copyright (c)2005 Microsoft Corporation. All rights reserved.

THIS INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.

The "Getting Started Guide" is now available with the Windows "Monad" Shell Beta 2 Documentation Pack, available from http://www.microsoft.com/downloads/details.aspx?FamilyID=8a3c71d1-18e5-49d7-952a-c55d694ecee3&DisplayLang=en. This guide will answer your basic questions about Monad and help you get started.

# Installing the Windows "Monad" Shell Beta 2 (for .NET Framework 2.0 RC/RTM)

Perform the following steps to install the Windows "Monad" Shell.

1. WARNING: If you need to uninstall the .NET Framework to upgrade it to RC/RTM release, and you have an earlier build of the Windows "Monad" Shell installed, then you must uninstall Monad (from Add/Remove Programs) BEFORE you uninstall the earlier .NET Framework
release. Otherwise, Monad uninstall will fail because it cannot detect the correct .NET Framework version.
2. To install or un-install Monad you must have admin privileges.
3. If you have Beta 1 of Monad:
   1. Backup any custom profiles you have created if you want to reuse them.
   2. In Control Panel, go to Add/Remove Programs and remove any entry containing "Microsoft Command Shell"
4. If you have old installation, prior to Beta 1:
   1. In Control Panel, go to Add/Remove Programs and remove any entry containing "Windows Command Shell Preview".
   2. You may need to manually remove the directory “C:\Program Files\Microsoft Command Shell Preview” and/or “C:\Program Files\Windows Longhorn Command Shell Preview."
5. Ensure you are running on Windows XP Service Pack 2, Windows Server 2003 Service Pack 1, or Longhorn Beta 2.
6. Verify that you have the correct version of the .NET Framework, RC/RTM.050727-xxxx. To check whether you have the correct version perform the following:
   1. In your %windows%\Microsoft.NET\Framework directory, check to see if you have a v2.0.50727 sub-directory. If you do not have this directory you do not have an RC/RTM release of the .NET Framework.
   2. If you have this sub-directory, right click on a DLL in this directory and choose Properties. Click on the Version tab, then click File Version under Item Name. The value should be 2.0.50727.42 (RTM.050727-4200). However this Monad release should work with earlier versions of 50727 such as 50727.26.
   3. If you do not have the right version of the .NET Framework then you need to install it from http://lab.msdn.microsoft.com/vs2005/get.
7. Run the MSI package in the x86 directory (for 32-bit machines) or the x64 directory (for 64-bit machines).

# Changes from Windows "Monad" Shell Beta 2 (for .NET Framework 2.0 Beta 2)

Although this release is essentially the same code base as the previous Beta 2 release (except moved to the RC/RTM version of .NET Framework 2.0), a few changes were made:

Monad's ExecutionPolicy is now configured to "Restricted" by default. This is a new value for ExecutionPolicy. In Restricted mode, scripts (.msh files) cannot be run and .mshxml files (types.mshxml and *.format.mshxml files) can only be run if they are signed by a trusted publisher (.mshxml files are treated the same as they are by the "AllSigned" policy). For msh.exe, this value is controlled via the registry setting "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSH\Microsoft.Management.Automation.msh\ExecutionPolicy". The earlier Beta 2 release defaulted to an ExecutionPolicy of "RemoteSigned".

For other shells, the ExecutionPolicy is controlled via the registry setting "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSH\<ShellId>\ExecutionPolicy" where "<ShellId>" can be obtained from the $shellid variable inside the shell.

When Monad first starts up it may ask a question "Do you want to run software from this untrusted publisher?" for the file "types.mshxml", published by Microsoft. You can choose to not load the file, but the file (and the *.format.mshxml files, which Monad will also prompt for if you do not select [A] for "Always run" for types.mshxml) controls the display and formatting of Monad and the experience in Monad will be degraded if it is not loaded. To avoid this prompt in the future, either select [A] for "Always run", or change the ExecutionPolicy from "Restricted" to "RemoteSigned".

The error text for certain execution errors references the "about_signing" help file. This file is not installed by Monad setup. However it is included here as a separate file. To enable this help, copy the file about_signing.help.txt to your Monad installation directory. You may need to exit and restart Monad for it to pick up the new file. The file is a plain text file which can be viewed in any text editor or word processor.

If you see an error at startup "The file "C:\Documents and Settings\All users\Documents\msh\profile.msh cannot be loaded. The execution of scripts is disabled on this machine" then either change the ExecutionPolicy from "Restricted" to "RemoteSigned", or sign the files using the set-authenticodesignature cmdlet (the error message is misleading; execution of .mshxml files is not entirely disabled when ExecutionPolicy is "Restricted", but they must be signed by a trusted publisher). The "about_signing" help file has more details. You can also delete the file; in the initial configuration, the profile.msh file does not add any functionality to Monad.

If do load the profile.msh file, and you have previously installed an earlier version of Monad, then on startup you may see a series of errors like:
set-alias : The AllScope option cannot be removed from the alias 'cat'.
At C:\Documents and Settings\All Users\Documents\msh\profile.msh:9 char:10
+ set-alias <<<< cat get-content
To fix this, either delete the file named ("C:\Documents and Settings\All Users\Documents\msh\profile.msh" in this example), or remove all the "set-alias" lines from it. Aliases defined in profile.msh in earlier versions of Monad are now defined internally by Monad before the profile is run, therefore the definitions in profile.msh generate an error attempting to redefine the alias.

Cmdlet parameters that are literal numbers will now get treated as numbers, whereas previously they used to be treated as strings. This may affect a script if the type of the parameter can be converted from a string but not from an integer. The user fix is to enclose the literal number in quotes. This change was in the earlier Monad Beta 2 but was not well communicated before.

The remaining notes are unchanged from the ones included with the prior Windows "Monad" Shell Beta 2 (for .NET Framework 2.0 Beta 2) release.

# Known Issues with Monad Beta 2

MSH crashes while get-content –wait is running on a file that is updated frequently.

UTF7 file encoding is not supported.

Set-item on an existing alias returns an error instead of writing a new value if –option ReadOnly is specified. Set-alias should be used instead.

Regardless of the file extension, the following reserved device names should not be used as the name of a file. If used, unpredictable behavior and data loss may occur.

`CON, PRN, AUX, NUL, COM1, COM2, COM3, COM4, COM5, COM6, COM7, COM8, COM9, LPT1, LPT2, LPT3, LPT4, LPT5, LPT6, LPT7, LPT8, LPT9`

Help content for write-warning and script-signing are missing.

Help content for new-object is incorrect.

# Important Changes in Monad Beta 2

COM interop feature has been added in this release. Documentation on how to use this feature is included in the "Getting Started Guide."

The concept of separate shells has been introduced in this version of MSH. If you are developing Cmdlets, review the information about Shells in the "Getting Started Guide."

When you run setup, it will automatically register an MSHSIP.dll to support script signing. To learn how to sign a script type:

`MSH> Set-AuthenticodeSignature -?`

and follow the instructions.

The following cmdlets have been added:

`compare-object, convert-HTML, export-clixml, import-clixml, start-transcript, stop-transcript, update-FormatData, update-typeData, write-warning`

Script block delegates feature is enabled in this release. However, currently it only works when the delegates are called on the same thread.

# Changes from the Beta 1 release

A system-wide profile is installed at "All Users\Documents\MSH\profile.msh". User specific profile should go in at "users\My Document\MSH\profile.msh"

The registry entry for Monad now has shellId - `HKLM:\SOFTWARE\Microsoft\msh\shellId\`

The format.mshxml file allows the user to define what properties will be displayed and in what format for any type. Setup will install a read only format.mshxml file. You can add additional format data in a separate file with .mshxml extension for your formatting requirements. Documentation on how to use this file is included in the "Getting Started Guide."

The types.mshxml file allows the static extension of types with added properties (which can be used by format.mshxml). Setup will install a read only types.mshxml file. You can add additional types data in a separate file with .mshxml extension for your formatting requirements. Documentation on how to use this file is included in the "Getting Started Guide."

Now there are 3 execution policy - AllSigned, RemoteSigned, Unrestricted. The default execution policy is RemoteSigned. For more details on execution policy, refer to "Getting Started Guide."