I apologize in advanced if this is a stupid question, but I was wondering is there a way to find objects created in a session of PowerShell that are not assigned to a variable?
for instance:
New-Object -TypeName WinSCP.Session
that would create an object, but with it not assigned to a variable, how do I .Dispose() it? is there a way? Or does that Object just remain until I close the PSSession?
I know with this particular class, there is a default timeout of 1 minute, but if that where not the case, what would happen?