This Script will also check and warn you if the snapshot exists for the VM and makes sure that your datastore capacity will not reduce to less than 20% after extending the drive to the requested amount.
Extend VM Disk Using Powershell
This Script will also check and warn you if the snapshot exists for the VM and makes sure that your datastore capacity will not reduce to less than 20% after extending the drive to the requested amount.