Here's the documentation from the GitHub site for those PowerShell commands.
The allowed consent plans cmdlets can be used to add or remove access to a particular type of consent plan from a tenant. “Internal” consent plans are either trial licenses or community plans that users can sign themselves up for via Power Apps/Power Automate portals. “Viral” consent plans are trial licenses that users can sign themselves up for via https://signup.microsoft.com or admins can assign to users via Azure Active Directory (Azure AD) or the Office 365 admin portal. By default all types of consent plans are allowed in a tenant. A common use case for these cmdlets is if a tenant admin wants to block users within their tenant from the ability to assign themselves trial licenses but retain the ability to assign trial licenses on behalf of users. This can be accomplished by using the Remove-AllowedConsentPlans -Types “Internal” command as well as disabling the setting AllowAdHocSubscriptions in Azure AD. It is important to note that when using Remove-AllowedConsentPlans all existing plans of the specified type will be removed from all users in the tenant and will not be recoverable. In addition, it will block all further assignment of plans of that type. If, at a later time, the tenant admin wishes to re-enable plans of that type they can use Add-AllowedConsentPlans. If they want to view the current state of allowed consent plans they can use Get-AllowedConsentPlans.
So Remove-AllowedConsentPlans is used to remove existing trial licenses from the tenant. But you still use Set-MsolCompanySettings -AlllowAdHocSubscriptions $false to disable user's ability to create trial licenses in the future. That command is not specific to Power Apps and will prevent user's from signing up for ANY trial. But if an administrator resets that setting long enough to create a trial and then resets it then the admin will be able to assign those trial licenses to anyone they wish to in the tenant.
But neither of those has anything to do with the new Self-service licensing feature that is currently rolling out. Self-service lets user's buy PAID licenses with their own credit card. The link i posted in the first reply has the PowerShell that you need to turn that feature off.