Unable to Debug host process

I’ve got a service account that is local admin.
Whether i run the Universal.Server.exe as a service with this account or just kick off the executable by hand running with this account, i am unable to access through the enter-pshostprocess
I find the process id(in a separate admin powershell session running as the same account), try to enter with that and get:

Enter-PSHostProcess : The 'Measure-Object' command was found in the module 'Microsoft.PowerShell.Utility', but the
module could not be loaded. For more information, run 'Import-Module Microsoft.PowerShell.Utility'.
At line:1 char:1
+ Enter-PSHostProcess 4400
+ ~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (Microsoft.Power...tProcessCommand:EnterPSHostProcessCommand) [Enter-P
   SHostProcess], RemoteException
    + FullyQualifiedErrorId : EnterPSHostProcessCannotPushRunspace,Microsoft.PowerShell.Commands.EnterPSHostProcessCommand


This is on Windows Server 2019

You likely won’t want to debug the Universal.Server.exe directly. Universal spins out separate PowerShell or PWSH processes for the various features of the platform.

What are you trying to debug? A dashboard?

In this particular case i’m trying to look at the $user object returned by my OIDC in the ‘authorization’ scripts. I’m following this guide which calls out:

Authentication and authorization scripts run within the Universal server. You can find the Universal.Server.exe process and attach to that.

https://docs.ironmansoftware.com/debugging/debugging-scripts#executing-your-script

Ah, duh. Yeah I gotcha. My fault.

If you just want to see the value of that variable, you could output it to a temp file:

$User | ConvertTo-Json | Out-File "$env:temp\user.txt"

I’m not 100% sure why this error is happening but have you tried to connect via a pwsh.exe (PS7) instance rather than Windows PowerShell?

1 Like

Same message on pwsh (v7).

I wonder if the ‘closed’ message on this issue from the powershell github is similar?