/\/\o\/\/ PowerShelled

This blog has moved to http://ThePowerShellGuy.com Greetings /\/\o\/\/
$AtomFeed = ("Atom.xml")
$PreviousItems = (" Read the raw Monad XML helpfiles "," MSH prompt-User function with Help "," Monad IRC Bot "," Getting performanceMonitor info from Monad "," Monad -and More bytes with -band = shorter script "," Tip from Monad "," MSH AD querying with .NET 2.0 framework "," get AD user allowed Logonhours from MSH "," MSH Show-Byte Function "," Let monad "drop" some chars "," ")

Saturday, December 17, 2005


MSH Welcome screen

Add welcome.msh to the end of your profile to get a more colorful Welcome :

gr /\/\o\/\/

$MS = @'
         A#$BBBB$2     b#$BB$$$C ###$#n                                                                          .   ,7o88c               
         MMMMMMMMM    IMMMMMMMM7tMMMMMI                                                                            iMMMMMM# &@#@@   
        CMMMMMMMM&   ;MMMMMMMMM  ;i:ic                                                                             MMMMM6. nMMMMM       
        &MMMMMMMMM  .MMMMMMMMMS i....     cZ@@&@Ec    .0ZAAC :I$v  7QMMMMME;      ;Z@MMMMM&Z:      .o#MMMM@A,  .EI$MMMMM;.iMMMMMBCn inc
     #09U8E   W8IZ.  IQZUZB .$8A9W     vQMMMM#n.   i$ZAEA       .A&MMM&W7      .XWMMMMM&#z.      :b&MMM&0Y     7WAAbb     Yz8Q$S     
$Shell = @'
          ...                                                                      i7           ...      tv                .t,   1c      
      .zMM#cEQMQ                                                                 .QMM.       iMMX;MMM  vMMM               tMM@ iMMM      
     .MM#     C,                                                                   MM       :MM#   :M   EMM                MMb  8MM      
     MMM            iB0M@:   :&WbMMY.@M@.  .n&8$M@.YMM0   .7MnBA   :@#ZMMn   .o&1ncMM        MMMi       zMMn&M7   .9&&;    MM6  SMM       
     MM@           MM7 ;MM# ,MMM,iMM&.8MM. YMMM.QMMn.MMM  MM8 MM$ ,MMMi,MM0 :MM.  SMM         9MMMM:    oMM.iMMz ;MM.1MM   MMA  1MM      
     MMM          @M@   .MM  SMM  MMC  MM.  MMi  MM  YMM   .i6MM#  YMM  &MW &MW    MM           ;&MMM   zM&  MMA MMW ,MM:  MM6  1MM      
     tMM7      ,. &M$    MM  7MM  MM7  MM   MM;  MM  cMM  zMM 9M0  ;MM  @M9 BM&    MM       .U    cMM$  tMM  MMX MMB       &MU  CMM      
      bMMM9:i:QM,  MMW  MM,  QMM  MM# .MM;  MMQ .MM, 0MM  MM& MMM  6MM  MM&  MMMY zMMi      YMM.  tMM   $MM  MMW  MMMoIM2  MM&  BMM       
        ,&M@&0i     vM90i   :EbQtYZbQ;SZ0Q Y88Q;S909i9ZQo  XQt.8W,.ZZ0Sv9Z0,  ;&&1:A        .WbW7;9.   :EbQCY9b0.  ;#&E,  7EEB:.bZW2  
Write-Host -fore "Blue" $ms
Write-Host -fore "Red" $shell
$d = [system.threading.thread]::getdomain()
$d.SetPrincipalPolicy([ System.Security.Principal.PrincipalPolicy]::WindowsPrincipal)
$p = [system.threading.thread]::currentPrincipal
$u = $p.identity.get_user()
Write-Host -fore "White" "`nWelcome $($u.Translate([system.security.principal.ntaccount])),`nIt's $(get-date) and Monad is at your Service`n"

Blogger /\/\o\/\/
if you get errrors remove spaces after @' sign

gr /\/\o\/\/

PS. Yep was a bit bored.
Blogger Tommy
I noticed in something Thomas Lee posted that you can also get current user by using:


Also, I found the version number formats nicely with:

$host.version | foreach { write-host $_"." }

Thanks for your posts!
Blogger /\/\o\/\/
>Tommy said...
>I noticed in something Thomas Lee >posted that you can also get >current user by using:


Yep, your right, I just copied this part from somewhere I actualy needed a real Principal for this purpose (only displaying) grabbing a Env var is as handy, i Just liked the ASCI art and wrote a quick script around it.

>Also, I found the version number >formats nicely with:

>$host.version | foreach { write-host $_"." }

this will do the same ;-)


embedded in a sting the ToString method will be called, so it is the same as this :


>Thanks for your posts!

glad you like them, and thanks for your reaction.
Post a Comment

Links to this post:

Create a Link

<< Home


October 2005   November 2005   December 2005   January 2006   February 2006   March 2006   April 2006   May 2006   June 2006   July 2006   August 2006   September 2006   October 2006   November 2006   December 2006  

$Links = ("PowerShell RC1 Docs"," PowerShell RC1 X86"," PowerShell RC1 X64"," Monad GettingStarted guide"," Monad Progamming Guide"," Monad SDK"," Monad videos on Channel 9"," MSH Community Workspace"," scripts.readify.net "," MonadSource"," www.reskit.net"," PowerShell Blog"," Under The Stairs"," computerperformance powershell Home"," proudlyserving"," MSH on wikipedia"," MSHWiki Channel 9"," Keith Hill's Blog"," Precision Computing"," PowerShell for fun"," MSH Memo (Japanese)"," monadblog")

find-blog -about "PowerShell","Monad" | out-Technorati.
find-blog -contains "","" | out-Technorati.
Web mow001.blogspot.com

This page is powered by Blogger. Isn't yours?