Outlook - get items inbox from shared mailbox

Hello a used this code for get items inbox from shared mailbox, but return blank. Can I help me, please?

 

$class = @"
using Microsoft.Office.Interop.Outlook;
public class MyOL{
public MAPIFolder GetInbox(string userName){
Application oOutlook = new Application();
NameSpace oNs = oOutlook.GetNamespace(“MAPI”);
Recipient oRep = oNs.CreateRecipient(userName);
MAPIFolder inbox = oNs.GetSharedDefaultFolder(oRep, OlDefaultFolders.olFolderInbox);
return inbox;
}
}
"@
Add-Type -AssemblyName Microsoft.Office.Interop.Outlook
Add-Type $class -ReferencedAssemblies Microsoft.Office.Interop.Outlook
$MyOL = New-Object MyOL
$email = $MyOL.GetInbox(‘test@email.com’)