![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
br> br> |
| |||||||
![]() |
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| Guest | Prevent Output I have this script (yes I am using some stuff from Quest) $VAR = 0 while ($VAR -ne 10) { $VAR++ New-QADUser -ParentContainer 'OU=Test,DC=domain,DC=local' -Name "Test User$var" } How can I prevent the script from showing a line for each user added. I just want a output line when the script has run. |
My System Specs![]() |
| | #2 (permalink) |
| Guest | Re: Prevent Output <ryanlsanders@gmail.com> wrote in message news:1180555213.973716.171960@q69g2000hsb.googlegroups.com... >I have this script (yes I am using some stuff from Quest) > > $VAR = 0 > while ($VAR -ne 10) > { > $VAR++ > New-QADUser -ParentContainer 'OU=Test,DC=domain,DC=local' -Name > "Test User$var" > } > > > How can I prevent the script from showing a line for each user added. > I just want a output line when the script has run. > You have a couple of options: $results = New-QADUser -ParentContainer 'OU=Test,DC=domain,DC=local' -Name "Test User$var" if you want to keep the output of this cmdlet. If you don't want the output at all then you could also do this: New-QADUser -ParentContainer 'OU=Test,DC=domain,DC=local' -Name "Test User$var" > $null -- Keith |
My System Specs![]() |
| | #3 (permalink) |
| Guest | RE: Prevent Output Piping to out-null should do the trick: $VAR = 0 while ($VAR -ne 10) { $VAR++ New-QADUser -ParentContainer 'OU=Test,DC=domain,DC=local' -Name "Test User$var" | out-null } -- greetings dreeschkind "ryanlsanders@gmail.com" wrote: > I have this script (yes I am using some stuff from Quest) > > $VAR = 0 > while ($VAR -ne 10) > { > $VAR++ > New-QADUser -ParentContainer 'OU=Test,DC=domain,DC=local' -Name > "Test User$var" > } > > > How can I prevent the script from showing a line for each user added. > I just want a output line when the script has run. > > |
My System Specs![]() |
| | #4 (permalink) |
| Guest | RE: Prevent Output $null = New-QADUser -ParentContainer 'OU=Test,DC=domain,DC=local' -Name "Test User$var" should work as well -- Richard Siddaway Please note that all scripts are supplied "as is" and with no warranty Blog: http://richardsiddaway.spaces.live.com/ PowerShell User Group: http://www.get-psuguk.org.uk "dreeschkind" wrote: > Piping to out-null should do the trick: > > $VAR = 0 > while ($VAR -ne 10) > { > $VAR++ > New-QADUser -ParentContainer 'OU=Test,DC=domain,DC=local' -Name "Test > User$var" | out-null > } > > -- > greetings > dreeschkind > > "ryanlsanders@gmail.com" wrote: > > > I have this script (yes I am using some stuff from Quest) > > > > $VAR = 0 > > while ($VAR -ne 10) > > { > > $VAR++ > > New-QADUser -ParentContainer 'OU=Test,DC=domain,DC=local' -Name > > "Test User$var" > > } > > > > > > How can I prevent the script from showing a line for each user added. > > I just want a output line when the script has run. > > > > |
My System Specs![]() |
| | #5 (permalink) |
| Guest | Re: Prevent Output > $VAR = 0 > while ($VAR -ne 10) > { > $VAR++ > [void] ( New-QADUser -ParentContainer 'OU=Test,DC=domain,DC=local' -Name "Test User$var" ) > > } > casting to void works.. here being a cmdlet you gotta put the expression in a () but if its say just a method on a dotnet object you could do [void]$a.additem() |
My System Specs![]() |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Password - Prevent or Allow to Change | Brink | Tutorials | 8 | 08-01-2008 02:59 PM |
| How to prevent thumbnails | joedee983 | Media Center | 0 | 07-01-2008 12:50 PM |
| How do I prevent ..... | Mike | Vista mail | 1 | 11-19-2007 07:09 PM |
| The DVD ROM prevent me from starting Vista | DeXtmL | Vista General | 3 | 10-05-2007 09:25 AM |
| No output from write-output | DouglasWoods | PowerShell | 3 | 04-13-2007 11:36 AM |