header1   header
header
header Register : : Login header
header
connector   connector
menuleft menuright
submenu   submenu
left
"Silence" the output
Last Post 26 Jul 2010 01:19 PM by jamiet. 4 Replies.
Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
jamietUser is Offline
New Member
New Member
Posts:12
Avatar

--
22 Jul 2010 08:54 AM
    Hi,
    POSH noob here.

    Very simple thing. I want to ensure that the output from sme of my cmdlets doesn't go to the console.

    For example, "mkdir FolderName" produces quite a lot of output. Is there an easy way to pipe it into another cmdlet that just "swallows it up" and doesn't do anything?

    I'm sure there's an obvious way of doing this but I can't figure it out.

    thanks
    Jamie
    PoSherLifeUser is Offline
    Basic Member
    Basic Member
    Posts:364
    Avatar

    --
    22 Jul 2010 09:32 AM
    "| Out-Null" or start the cmd with "[void]"
    When at first you don't succeed Step-Into

    http://theposherlife.blogspot.com
    http://www.jandctravels.com

    jamietUser is Offline
    New Member
    New Member
    Posts:12
    Avatar

    --
    22 Jul 2010 11:26 AM
    awesome. I knew it would be simple.Thank you very much.
    0ptikGhostUser is Offline
    Basic Member
    Basic Member
    Posts:296
    Avatar

    --
    26 Jul 2010 01:11 PM

    To summarize the thread (and to add one more alternative):

    • pipe to Out-Null: expression | Out-Null
    • convert to [null]: [null](expression)
    • assign to $null: $null = expression
    jamietUser is Offline
    New Member
    New Member
    Posts:12
    Avatar

    --
    26 Jul 2010 01:19 PM
    thank you all. i've bookemarked this thread on delicious in case anyone's bothered http://delicious.com/jamiethomson/powershell
    You are not authorized to post a reply.


    Active Forums 4.3
    right
    footer   footer
    footer Sponsored by Quest Software • SAPIEN Technologies • Compellent • Microsoft Windows Server 2008 R2 footer
    footer   footer