How to execute a function in a remote computer

I am trying to execute a function in a remote desktop to install an application and change folder permissions.  The function is part of a module that is located in a shared server.  I am using the following line of code to import the module.

$session = new-possession -computername "RemoteComputer" -credential $cred

invoke-command -Session $session {import-module MyModule}

Those line import the module with no issues.  The issue is that when I try to run the function nothing happen.  I get no errors, but the application do not install either.  I am using the following code:

invoke-command -session $session {install-application}

How can I accomplish this task?  Any suggestions?