you can't as you don't have the password.
How to use gMSA account with Powershell
"When a gMSA is used as service principals, the Windows operating system manages the password for the account instead of relying on the administrator to manage the password."
"The Key Distribution Service shares a secret which is used to create keys for the account. These keys are periodically changed. For a gMSA the domain controller computes the password on the key provided by the Key Distribution Services, in addition to other attributes of the gMSA. Member hosts can obtain the current and preceding password values by contacting a domain controller."
"gMSAs provide a single identity solution for services running on a server farm, or on systems behind Network Load Balancer. By providing a gMSA solution, services can be configured for the new gMSA principal and the password management is handled by Windows."
(If the reply was helpful please don't forget to upvote or accept as answer, thank you)