Problem fixed
The problem has been completely addressed by making the following change in the PowerShell code:
Replace
by
Replace
$winscpSession.Dispose # Close and dispose object.
by
$winscpSession.Dispose() # Close and dispose object. Note the pair of parentheses
# added at the end of the method name.