I am attempting to start an app interactively with the desktop. With the following code the script just runs until killed. If I remove the top two lines it runs and finishes but obviously doesn't interact with the desktop.
$cred = (Get-Credential $env:USERNAME)
Enter-PSSession -computerName "$env:computername" -credential $cred
cd $env:userprofile\Desktop
.\Loader.bat
I would be grateful for any suggestions.