Forum Discussion
Ashish_Arya
Dec 19, 2023Brass Contributor
How to reduce the script execution time to shut down the unused Hostpool AVDs
 Hi Team,     Below is the attached script which I am using to shut down the unsed AVDs (which are not in deallocated state) to save some cost.  The issue with this script is that it is taking lot of ...
NKC25
Jan 10, 2024Brass Contributor
Not sure if this can help you, test out in non prod 🙂 first use this module Az.AVD (https://www.powershellgallery.com/packages/Az.Avd/3.1.1) you have options to get the powerstate of the virtual machine, though inside the module it will use the restapi instanceview of the VM, but it might be faster compare to get-azvm.
https://www.powershellgallery.com/packages/Az.Avd/3.1.1/Content/Public%5CGet-AvdSessionHostPowerState.ps1