Deleting a folder and removing a reg key

Hi Guys

Im really new to PSDT and I need to perform the AppData\Local\Microsoft\Teams folder deletion and remove a registry key before installing my application. The command im using is

Remove-Folder -Path “$envAppData\Local\Microsoft\Teams”
Remove-RegistryKey -Key ‘HKEY_CURRENT_USER\Software\Microsoft\Office\Teams\PreventInstallationFromMsi’

The folder is not being removed any tips on what im missing?

I see I was using the wrong variable. I now used $envLocalAppData but it still wont delete

https://allnewandimproved.psappdeploytoolkit.com/functions/Remove-RegistryKey.html

try adding the -verbose parameter

The incorrect ENV variable is being used. It should be -Path “$env:LOCALAPPDATA\Microsoft\Teams”

Or you can try -Path ${Env:LOCALAPPDATA}\Microsoft\Teams