I’ve written a Constrained Endpoint where the task to be performed is fixed, and launched from the StartupScript. No other user parameters.
The idea is running it with an empty scriptblock, as
Invoke-Command -ScriptBlock {} -Restofparams.
It works perfectly…
… but I’d like to add an extra check in the StartScript.ps1 to avoid allowed users calling instead
Enter-PsSession -InTheSameEndpoint
I’ve found many variables, methods and objects to check the caller identity ($PSSenderInfo, $ExecutionContext,$PSSessionOption, and some calls to Get-WSManInstance)… but how can I get the original way the cmdlet was run in the client ?
TIA,
jc