The scriptUser session was being used to retrieve HCX vm information and it's role does have the priviledge to turn on/off the VM.
Solution
Using the tempUser session with VC to retrieve the HCX vm information and pass that to subsequent function calls.
I have read the contributor guidelines and have completed the following:
[x] Formatted the code using VSCode default formatter for PowerShell.
[x] Tested the code end-to-end against an SDDC.
[x] Documented the functions using standard PowerShell markup and applied AVSAttribute to newly exported functions.
Problem
The scriptUser session was being used to retrieve HCX vm information and it's role does have the priviledge to turn on/off the VM.
Solution
Using the tempUser session with VC to retrieve the HCX vm information and pass that to subsequent function calls. I have read the contributor guidelines and have completed the following:
AVSAttribute
to newly exported functions.