Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Oh dear!

 
Logged in as: Guest
arrSession:exec spGetSession 2,5,32746
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> Windows PowerShell >> Oh dear!
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Oh dear! - 3/27/2006 11:15:11 PM   
  L12

 

Posts: 22
Score: 0
Joined: 1/19/2006
Status: offline
Okay, so I've just downloaded Monad Beta version 3.1 and thought I'd give this new fangled thing a go. It took me enough time to actually un-restrict my files let alone figure out what's going on. I've read a few of the links here and it doesn't look too bad, but I'm having some problems understanding the way things work. I tried creating a basic script, just using a couple of strings, an if else statement and a while loop:


      

Obviously, my syntax is all wrong, because I get the error:

Incomplete string token
At D:\Profiles\Gornalln\Desktop\FirstMonad.msh:11 char:22
+  elseif ($strName = "M <<<< ark") {

Should I be using double quotes to compare literal values or am I way off the mark (like I suspect  )?
Also, a couple of quick questions:

1. Is this language case sensitive? I'd simply test it if I could get anything working
2. Is there any way to run these scripts outside of the Windows Command Shell? I'm not sure how I'd actually run one of these scripts on a remote computer (assuming it has Monad installed on it obviously).


Thanks for any replies, in the meantime I'm going to read up on all these links and see if they have a newbie newbie guide :)
 
 
Post #: 1
 
 RE: Oh dear! - 3/28/2006 2:41:59 AM   
  ebgreen


Posts: 4613
Score: 31
Joined: 7/12/2005
Status: offline
This should work for you:


      

1. Is this language case sensitive? I'd simply test it if I could get anything working
No.
2. Is there any way to run these scripts outside of the Windows Command Shell? I'm not sure how I'd actually run one of these scripts on a remote computer (assuming it has Monad installed on it obviously).
Not sure, but it is certainly something that is worth looking in to.

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to L12)
 
 
Post #: 2
 
 RE: Oh dear! - 3/28/2006 6:52:41 PM   
  L12

 

Posts: 22
Score: 0
Joined: 1/19/2006
Status: offline
Great, thanks :)

I also found this link to a msdn blog which may prove useful:

http://blogs.msdn.com/monad/archive/2006/02.aspx

Had a nice tip in there for loading & saving txt from/into txt files:

To write sometext to to a text file called Test:

${c:\Test.txt} = "SomeText"


To then read that text:

write-host ${c:\Test.txt}

How simple is that? I think it's going to take some effort to learn (especially the scopes and different modes), but I'm really impressed so far with what I've seen of Monad.

Strange, it seems when you use write-host, it just prints the whole of the contents of the text file to one line, whereas if you just had ${c:\Test.txt} then it will print each line of Test.txt as it is in the document. Time to RTFM again I think :P

< Message edited by L12 -- 3/28/2006 9:05:31 PM >

(in reply to L12)
 
 
Post #: 3
 
 RE: Oh dear! - 3/29/2006 1:13:33 AM   
  ebgreen


Posts: 4613
Score: 31
Joined: 7/12/2005
Status: offline
Not starnge at all. Here is how the line breaks down:

write-host   ${c:\Test.txt}
|-----------|  |----------------|
      |                      |
      |                      |--------------------- The object given is this text file
      |
      |------------------ Use the .ToString method of the specified object to write it to STDOUT

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to L12)
 
 
Post #: 4
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> Windows PowerShell >> Oh dear! Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts