Creating script in PowerShell instead of using Azure Cli

I have been able to fine Azure CLI AZ commands to use extensions to change admin password on RHEL 7 servers.
But I would really prefer to do this with the new PowerShell AZ modules.
[pre] az vm user update --resource-group $($vm.ResourceGroupName) --name $($vm.Name) --username $UserName --password $NewPassword
if ( $? ) {
Write-Verbose -Message “Password reset for $($vm.Name). Restarting ssh!”
Sleep -Seconds 3
az vm user reset-ssh --name $($vm.Name) --resource-group $($vm.ResourceGroupName)
}
[/pre]

Anyone know the specifics of how to do this in Powershell without using cli2?

Looks like you might be able to change the admin user password using Set-AzVMOperatingSystem -Credential. Not sure how this affects SSH credentials.

See Set-AzVMOperatingSystem