You Might have a memory leak if…

Your PowerShell session consumes 4GB of ram in less than 3 seconds…

Don't try this at home!
Don't try this at home!

while I didn’t think vista was suppose to allow such things.  My code caused the crash not PowerShell itself!

~Glenn

Update:  okay so a decimal point blew it up!  The Netapp API returns the dtg in the form of a int64.  Without adding an explicit cast powershell treated it as an int.  What does that mean? Well it’s the difference between the following:

My code…
[datetime]::FromFileTime(116444916000000000 + ($_.”last-scrub-timestamp”) * 10000000)

At run time this became:
[datetime]::FromFileTime(116444916000000000 + 1.226210494E+16)

and it blows up VERY quickly, vs:

New code:
[datetime]::FromFileTime(116444916000000000 + int64 * 10000000)

at run time:
[datetime]::FromFileTime(116444916000000000 + 12262104940000000)

Sunday, November 09, 2008 6:01:34 AM

Leave a Reply