SharpeRAD / Cake.Powershell

Powershell addin for Cake
http://cakebuild.net
MIT License
83 stars 36 forks source link

Disable logging for Powershell command (sensitive) parameters #64

Open javicrespo opened 5 years ago

javicrespo commented 5 years ago

Hi,

This method

https://github.com/SharpeRAD/Cake.Powershell/blob/25d002311fb2566f7cf5be9ea6fcb44445fa41bf/src/Cake.Powershell/Runner/PowershellRunner.cs#L221

logs powershell commands including parameters... I'm passing an api key as a plain string to a powershell function (not as a SecureString, can I do that with Cake?) and because of the LogExecutingCommand I see the apikey in the cake output log... Do you think it'd make sense to add an option to disable command/parameter logging? If I bump the global cake log level above debug then I'll be missing insights from other tasks in the build process...

SharpeRAD commented 5 years ago

Simple work around would be to get the API key from an environment variable inside the Powershell script rather than pass it in as an argument.