Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > PowerShell

Vista - Nothing - VBScript / Powershell

Reply
 
Old 06-25-2009   #1 (permalink)
Carlos Felipe França da Fonseca


 
 

Nothing - VBScript / Powershell

In Powershell, what's the equivalent to NOTHING from VBScript?

Thanks!

Felipe

My System SpecsSystem Spec
Old 06-29-2009   #2 (permalink)
Alex K. Angelopoulos


 
 

Re: Nothing - VBScript / Powershell

"Carlos Felipe França da Fonseca" <carlosfelipefranca@xxxxxx> wrote in
message news:eJ$kz7c9JHA.1336@xxxxxx
Quote:

> In Powershell, what's the equivalent to NOTHING from VBScript?
>
> Thanks!
There is no exact equivalent due to lazy garbage collection, but you can get
the same effect on variable association by using Remove-Variable. For
example:

$MyVar = 1234
Remove-Variable MyVar


My System SpecsSystem Spec
Old 06-29-2009   #3 (permalink)
Alex K. Angelopoulos


 
 

Re: Nothing - VBScript / Powershell

Come to think of it, John's suggestion is a close equivalent as well. The
distinction between his method and mine is that if you set a variable to
$null, the variable still exists (which is the case with setting a variable
to Nothing in VBScript).

"Alex K. Angelopoulos" <alex(dot) k(dot again)angelopoulos(at)gmail.com>
wrote in message news:umonboS#JHA.5040@xxxxxx
Quote:

> "Carlos Felipe França da Fonseca" <carlosfelipefranca@xxxxxx> wrote in
> message news:eJ$kz7c9JHA.1336@xxxxxx
Quote:

>> In Powershell, what's the equivalent to NOTHING from VBScript?
>>
>> Thanks!
>
> There is no exact equivalent due to lazy garbage collection, but you can
> get the same effect on variable association by using Remove-Variable. For
> example:
>
> $MyVar = 1234
> Remove-Variable MyVar
>
>
My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
VBScript or Powershell ? VB Script
Equivalent of powershell to vbscript command PowerShell
Return Powershell Error to VBscript PowerShell
VBScript vs. PowerShell error handling PowerShell
Powershell does not terminate when started VBSCRIPT PowerShell


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46