vMarkusK / Advanced-PRTG-Sensors

Collection of my Advanced PRTG Sensors
https://mycloudrevolution.com/
Apache License 2.0
69 stars 29 forks source link

Fix order in trap handler #74

Closed broth-itk closed 3 years ago

broth-itk commented 3 years ago

Original:

    if($RemoteSession){Remove-PSSession -Session $RemoteSession}
    Disconnect-VBRServer -ErrorAction SilentlyContinue

Proposal:

    Disconnect-VBRServer -ErrorAction SilentlyContinue
    if($RemoteSession){Remove-PSSession -Session $RemoteSession}

When using a remote session, "Disconnect-VBRServer" should be run on the remote machine, then close remote session.