About non-interactive -d, it just runs the command, without returning output and then terminates remote prompt. Actually, it does, by only returning the error code of remote process. In your case, it shows the output of $file on a non-existent, hidden cmd window on remote machine and terminates. That's why you don't see anything. Try to create a file on remote machine using -d switch and then you see it works.
Update:
If $file is a variable in remote machine, the problem is you're using a variable that expands in your local powershell environment (as you mentioned) so use a cmd variable instead (considering you're sending the command to cmd) that doesn't expand in powershell. PSExec.exe \\$hostname -u user -p pass -d cmd /c "type %file%" 2> $null
However, that's not the REAL solution! because what if you want to send a command to powershell remotely? You need something preventing the expansion, like %%varibale%% in cmd. I've found using " will expand, but ' prevents expanding in powershell:
PS> "This is $file" against PS> 'This is $file'
But that doesn't help in your case, another way though, is to create an script in local machine, and send to destination with PSEXEC:
PSExec.exe \\$hostname -u user -p pass -c powershell script.ps1 2> $null
Or... use Invoke-Command as mentioned here:
PS C:\> invoke-command -filepath c:\scripts\test.ps1 -computerName $hostname