Script crshes ISE

Perez, Oscar 21 Reputation points

Good afternoon,

I downloaded the Get-NetSession.ps1 script from the TechNet Script Center Gallery, but I needed the number of open files, so I substituted SESSION_INFO_10 for SESSION_INFO_1 and defined the two extra fields. It runs and returns the open files, but it crashes ISE right after that.

Does anyone have any ideas why its doing this?

Running on a Windows 10 Enterprise Edition workstation.


Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,449 questions
0 comments No comments
{count} votes

Accepted answer
  1. Rich Matheisen 45,671 Reputation points

    Considering you're dealing with values returned by a Win32 function, I'd have to guess that your definition of the structure that holds each value is incorrect. Most likely the definition you've used has understated the size of the struct and you've overflowed the stack which holds the information necessary the return to the ISE.

    0 comments No comments

0 additional answers

Sort by: Most helpful