I wrote a powershell script to get the passthrough devices of VM(s)/host and write the pci devices uid and vm id to stdout.
However I noticed that the first execution of this script is noticeably slower than the following times I would run the script:
Here is the get_passthrough.ps1 script that I've been testing with:
Here is the PowerCLI version:
Here is the powershell version:
Is there any optimizations that I can do to the script to improve the performance and get rid of the additional 9 seconds of latency at the first run?