mirror of
https://github.com/GoodOlClint/PSProxmoxVE.git
synced 2026-09-06 03:59:04 +00:00
fa930db71a
Fixes from correctness and api-compat reviews: 1. Use BoundParameters to distinguish -Session omitted from -Session $null, preventing accidental active-session clear when $null is passed. 2. Warn and return early when -Session is supplied but not the active session, avoiding silent no-ops that leave the user's session variable populated and functional but with expectations misaligned (they passed a session to disconnect it, but disconnecting a non-active session is now explicit). 3. Use ReferenceEquals() explicitly instead of == for the identity check, future-proofing against PveSession ever gaining value-equality semantics. 4. Fix the lifecycle test to check observable behavior (warning output) instead of reaching into null PrivateData. Tests now verify both "no session to disconnect" and "non-active session supplied" paths.