This script helps you to uninstall programs using PowerShell as to make it dynamic I made it as function so you can bypass the name of the program that you want to uninstall it
Here you can find how to run it
PS C:\Windows\system32> uninstallapp "microsoft lync 2010"
below you will get result like this one
__GENUS : 2__CLASS : __PARAMETERS__SUPERCLASS :__DYNASTY : __PARAMETERS__RELPATH :__PROPERTY_COUNT : 1__DERIVATION : {}__SERVER :__NAMESPACE :__PATH :ReturnValue : 0