Tuesday, February 9, 2010

Powershell ISE does not honour scope operators

Write this in a script file and open that in Powershell ISE.

$Script:Abc=10

function abc

{

$k = 10

}

# Do some processing

$Script:Abc = 20

abc

Execute above statements using Run button in ISE and check get-variable. you will find that Abc is still set in. Next invocation of script will start with Abc being set as 20. Reason being that powershell ISE calls scripts using dot-sourcing.

Alternate for this trouble can be using all variables inside some functions.

in.sun.com still available when sun.com went into oblivion

 

in.sun.com is still available when sun.com is gone.

sun.com now takes us to oracle.com. But, sun worldwide is still displaying sun.com address :-) Lot much needs to be done than front page eyewash only. 

 

SunWorld