I have a CMD file from which I have to run a Powershell script passing in username and password: i.e: PowerShell -File "%1" -Computer "%2" -Username "%3" -Password "%4". Is there anyway to send a SecureString password from the CMD to the powershell script?
Let me add a few more points to make my predicament clearer: So whenever I execute this CMD file containing the above said Powershell command, I am passing in the values for all the parameters(%1% to %4%) on the command line. Now when I pass these arguments, they are passed in as clear text and everything is logged into the Events Monitor with ID 4688 with Advanced Auditing enabled. What I want is the password to not be visible in this case.