Help - Search - Members - Calendar
Full Version: Monad released!
MSFN Forums > The General Stuff > General Discussion

   
Google Internet Forums Unattended CD/DVD Guide
Martin Zugec
Even through monad beta release was planned for end of this month (21), it is already avaiable for download at MS beta site!!!

Have you tried it? Do you LOVE it the same way I do? Lets share your opinion...
Zxian
Link? I'd like to try it out. Or do you have to sign up as an official beta tester?
Martin Zugec
Try to go to beta.microsoft.com and log with GuestID mshPDC (case sensitive!)

I was impressed long time ago with alpha, but this beta is simply amazing!

For example accessing WMI classes is awesome!
CODE
C:\> $strBiosManufacturer = get-WMIObject Win32_BIOS | get-member Manufacturer
C:\> write-object $strBiosManufacturer.Value
Dell Computer Corporation
C:\> write-object $strBiosManufacturer


   TypeName: System.Management.ManagementObject#root\cimv2\Win32_BIOS

Name         MemberType Definition
----         ---------- ----------
Manufacturer Property   System.String Manufacturer {get;set;}


C:\>


Or another example...

Accessing diferent providers as filesystem. Like registry:
CODE
C:\> Set-Location HKLM:\Software
HKLM:\Software> Get-ChildItem


   Hive: Registry::HKEY_LOCAL_MACHINE\Software

SKC  VC Name                           Property
---  -- ----                           --------
 0   2 AdMuncher                      {AppPath, MigrateDone}
 2   0 Adobe                          {}
10   0 Ahead                          {}
 5   0 ATI Technologies               {}
 1   0 ATI Technologies Inc`.         {}
 1   0 Battle`.net                    {}
 1   0 Blizzard Entertainment         {}
 2   0 Broadcom                       {}
 1   1 C07ft5Y                        {(default)}
 9   1 CheckPoint                     {CPTMPDIR}
148   0 Classes                        {}
10   0 Clients                        {}
16   0 ComputerAssociates             {}
 1   0 Crimson System                 {}
 1   0 Dell Computer Corporation      {}
 3   0 DivXNetworks                   {}
 4   0 Ericsson                       {}
 2   0 Extended Systems               {}
 1   0 Gemplus                        {}
 1   0 Ghisler                        {}
 1   1 GIANTCompany                   {DefSyncFailure}
 1   0 Google                         {}
 1   0 Headlight                      {}
 1   0 InstalledOptions               {}
 1   0 InstallShield                  {}
 1   0 InterMute                      {}
 1   0 MDC                            {}
123   1 Microsoft                      {(default)}
 1   0 Microsoft Press                {}
 0   1 Miranda                        {Install_Dir}
 1   0 Netgroup - Politecnico di T... {}
 1   0 Nullsoft                       {}
 2   0 ODBC                           {}
 0   1 Phonemonitor                   {IsRunning}
 1   0 PocketSoft                     {}
 2   0 Policies                       {}
 0   1 Program Groups                 {ConvertedToLinks}
 1   0 Schlumberger                   {}
 0   0 Secure                         {}
 1   0 Siber Systems                  {}
 1   0 SigmaTel                       {}
 1   0 Skype                          {}
 1   0 Soeperman Enterprises Ltd`.    {}
 1   0 Sony Ericsson                  {}
 1   0 Trymedia Systems               {}
 3   1 Widcomm                        {(default)}
 2   0 Windows 3`.1 Migration Status  {}
 1   0 Wise Solutions                 {}


HKLM:\Software>


Or manipulating with variables similar way to FSO!
CODE
C:\> set-location variable:
Variable:\> get-ChildItem

Name                           Value
----                           -----
Error                          {DriveNotFound,System.Management.Automation.C..
DebugPreference                SilentlyContinue
ace                            System.Security.AccessControl.FileSystemAcces..
first                          False
catr                           d----
HOME                           C:\Documents and Settings\mzugec
strBiosManufacturer            System.String Manufacturer {get;set;}
Host                           System.Management.Automation.Internal.Host.In..
MaximumHistoryCount            64
MaximumAliasCount              4096
foreach                        System.Collections.ArrayList+ArrayListEnumera..
input                          System.Array+SZArrayEnumerator
StackTrace                     System.Management.Automation.CommandNotFoundE..
ReportErrorShowSource          1
ExecutionContext               System.Management.Automation.EngineIntrinsics
true                           True
VerbosePreference              Continue
MSHHOME                        C:\Program Files\Microsoft Command Shell
false                          False
null
MaximumFunctionCount           4096
ErrorActionPreference          Continue
ReportErrorShowStackTrace      0
?                              True
this
^                              set-location
_
ReportErrorShowExceptionClass  0
ProgressPreference             Continue
MyInvocation                   System.Management.Automation.InvocationInfo
args                           {}
MaximumErrorCount              256
$                              variable:
ReportErrorShowInnerException  0
toString                       NT AUTHORITY\SYSTEM Allow  FullControl
PID                            3824
MaximumDriveCount              4096
MaximumVariableCount           4096


Variable:\>


Or this:
Show me processes and show me sum of working set they are using
CODE
C:\> get-process | Measure-Object -property WorkingSet -Sum


Count    : 61
Average  :
Sum      : 169435136
Max      :
Min      :
Property : WorkingSet



C:\>


Maybe now you will understand why I am so fascinated smile.gif Hope so in few days new geeks will come and share their knowledge about MSH biggrin.gif
Martin Zugec
Another super thing for testing purposes - whatif?

What should happend if I run this command?

There is switch (-whatif), that will not perform the action, it will only show you what will happen!
CODE
C:\> get-process w* | stop-process –whatif
What if: Operation "stop-process" on Target "wdfmgr (772)"
What if: Operation "stop-process" on Target "winlogon (984)"
What if: Operation "stop-process" on Target "WINWORD (3504)"
What if: Operation "stop-process" on Target "WLTRAY (2808)"
What if: Operation "stop-process" on Target "WLTRYSVC (1888)"
C:\>


In this case it would kill 4 processes
Zxian
Thanks for the info. Looks very promising... thumbup.gif
Martin Zugec
Wow! No need to use the world, if you know batches, you can see from the code what can be done:

CODE
MSH> Function funcHelloWorld {
>> param ($strName = (read-host "What is your name, dear MSFN user?"))
>> "Hi $strName, welcome to wonderful world of Monad!"
>> }
>>
MSH> funcHelloWorld
What is your name, dear MSFN user?Martin
Hi Martin, welcome to wonderful world of Monad!
MSH> funcHelloWorld Martin
Hi Martin, welcome to wonderful world of Monad!
MSH>
Zxian
QUOTE (Martin Zugec @ Jun 17 2005, 02:19 PM)
Wow! No need to use the world, if you know batches, you can see from the code what can be done:

CODE
MSH> Function funcHelloWorld {
>> param ($strName = (read-host "What is your name, dear MSFN user?"))
>> "Hi $strName, welcome to wonderful world of Monad!"
>> }
>>
MSH> funcHelloWorld
What is your name, dear MSFN user?Martin
Hi Martin, welcome to wonderful world of Monad!
MSH> funcHelloWorld Martin
Hi Martin, welcome to wonderful world of Monad!
MSH>

*



Wow... that's crazy powerful... it's like a built in C interpreter...
gamehead200
Just got the e-mail! Very cool! biggrin.gif
Nois3
I heard this got killed off in the next release of Windows...
Nois3
It's True

QUOTE
"It will take three to five years to fully develop and deliver," said Microsoft Senior Vice President Bob Muglia this week at Tech Ed 2005. "We're also building a next-generation user interface, taking our existing Microsoft Management Console (MMC) technology to the next level in terms of usability."


Holy Crap! 3-5 YEARS!!! That's just plain stupid. It took 5 years to go from DOS to Win98.

Sorry Martin... looks like it's back to the old batch files smile.gif
Martin Zugec
I would like to say something about this hoax (3-5 years)...

It wasnt meant that monad will be ready in 3-5 years. It was ment that Monad will achieve full support in this time period - that means that every tool/utility/program from microsoft, including big ones like exchange, sms, IIS etc. will be ported to MSH
Martin Zugec
Hmmm, so there is nobody interested in MSH like me? sad.gif
xper
I wrote about it 7 days ago.

http://www.msfn.org/comments.php?id=13481&...highlight=monad
Martin Zugec
Yep, I know... There were few articles/comments about it here.

What I am talking about is this board is orientated mainly on "geeks" - home/pro users, that likes to play with system.

And there is nobody here really working/testing Monad sad.gif I would like to have some place to talk about different cmdlets, functions etc. Official forums are quite unhandy sad.gif
Nois3
@ Martin,

I think you'll find very few people interested in this.

Personally I'd rather script in VBS. I understand this is a new command shell, and it's not just for scripting. But seriously, if I'm going to spend even 20 minutes working on a "process" to do something, I'm going to save the sucker to a file.

Manually typing in a command to "find all files in C:\temp containing the string 'test' with the extention .tmp" is all well and fine. But anything more complex than that I'm going to write a full blown script.

I fully acknowledge that Monad is much more powerful than the command shell. But I doubt you can do more in Monad than you can in VBS. In addition VBS seems simpler to me.

In my opinion Monad is just another product that Microsoft's marketing department forced them to make. It's not really needed, but they need something similar to UNIX shell's - simply so they can say, "Windows can do that too!"

Perhap's I'm missing the big picture (I usually do - LOL). I respect your opinions Martin.... what am I missing here?
dman
QUOTE
Manually typing in a command to "find all files in C:\temp containing the string 'test' with the extention .tmp" is all well and fine. But anything more complex than that I'm going to write a full blown script.
From monad.rtf documant:

QUOTE
Scripts
Commands may be aggregated into files, or "scripts," and MSH language scripts may be run from within an MSH.EXE session.  To be recognized as an MSH script the script must have the extension .msh.  To run an MSH script, simply type the name of the script without the extension.  The prerelease will look in the $ENV:PATH for files with the .msh extension and will execute the first script found by the typed name.  Arguments to the script can just be added to the end of the script name.
MSH> mshscript arg1 arg2

Scripts that are run in this way run in a new scope.  This means that variables that have been created on the command line are safe from modification unless the script explicitly wants to change the value in a different scope.  If you want to run the script in the current scope then execute the script as follows:
MSH> . mshscript arg1 arg2

The "." tells the shell to execute the script in the current scope.  To run it from a cmd.exe prompt use this format:
C:\> msh –NoLogo –Command mshscript arg1 arg2


I think you may be missing the point that monad is also scriptable.
Nois3
@ dman,

So this means we will basically have three different ways to create scripts for Windows machines. The good old fashoned CMD shell, VBS/JS/WSH and now Monad. (I won't mention the k/c shells available with Microsoft Service for UNIX - shhh smile.gif)

All are capable of scripting. Monad and Cmd also have the ability of direct input. Monad and VBS seem equil in power and capabilities; ie. creating functions, nested loops, all that programming mumbo jumbo.

I guess it boils down to which one is easier for the Administrator to use. Assuming notepad.exe is your editor, which one is the easiest to code for. Judging from Martins examples it seems like Monad is more intuitive. I really cant judgement call on this without experience with Monad.

@ Martin,

A couple questions if you please, sir.
What do you see as Monad's limitations?
You have extensive experience with cmd and vbs, how does Monad compare?
Does Monad allow control of other PC's on the network? If so, do these PC's need Monad installed or is control through DCOM/WSH?
Martin Zugec
Ok, I will first answer last question smile.gif Monad dont have support for remote computing - it will of course be available in final version, now it is not.

Monad (current version) have only two limitation - dont support remote networking and second thing is aliases cant contain parameters.

Now for the harder part - comparing CMD vs. WSH vs. Monad.

Well, it wont be so hard at all smile.gif Monad containt all features of CMD + WSH + much more.
WSH
Monad have same advantages as WSH.
For example accessing WMI objects is quite simple and logical:
CODE
MSH> $objBios = get-WMIObject Win32_Bios
MSH> $objBios.Name
Phoenix ROM BIOS PLUS Version 1.10 A02
MSH>


You can using objects in Monad using cmdlet net-object, so you can do the same as in vbscript.
CODE
$objShell = New-Object –ActiveX “WScript.Shell”


CMD
You can use everything from cmd in Monad, so there is no reason why not using MSH instead of cmd. Implementation of StdIn/StdOut is quite simple to do, so I didnt encounter any compatibility problems at all.

What is the main reason to use MSH for me is that
a.) in 3-5 years (according to MS) every program from MS will have support for Monad. So you could do (similar to *nix) everything from cmd.
b.) it is frontend to .NET. I cannot fully work with it yet (as I am not programmer), but it is quite similar process like WMIC - but it is much more powerfull. It is just not another shell, it is shell + language + framework.
Google Internet Forums Unattended CD/DVD Guide
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.