I have an external program which calls a PowerShell script with a random secret identifier as a single argument. The PowerShell script needs to return the same random secret id when it calls the REST client on the external program.
Even though the PowerShell scripts are in secured location on the server, anyone can open the PowerShell and debug it to get $args[0] value. The PowerShell script cannot run on its own as it needs get a secret id from an external program.
I have tried using this script:
$gg = [Security.Principal.WindowsIdentity]::GetCurrent().Name
$args[0]
$gg
The external program calls the PowerShell script every 2 seconds and passed the secret identifier. During debugging - I could not get a value of $args[0].
Any feedback is wished upon. Am I correct that no one can debug and get the value of the argument even in the debugging?