I am a very fond user of Windows Terminal, and use it a lot for WSL, Powershell, etc.
I run it in my normal user context, but I sometimes need administrative privileges to our domain controllers.
Therefore I save my admin credentials and use them in a pssession command, and imports that pssession. But when doing this, piping does not work.
A simple command like: "get-aduser <username> | Get-ADPrincipalGroupMembership" throws an exception.
"Cannot validate argument on parameter 'Identity'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again."
From the error message, I conclude that the current object '$_' is for whatever reason not passed through to the next command, but why?
And is there some way to correct this?