Expand Minimize

SPC029106: Use PSCredential type for credential parameters

PowerShell security best practices state that the PSCredential type should be used to secure credentials correctly. Also the CredentialAttribute has to be applied after the PSCredential attribute to be correctly parsed and secure.

CheckId SPC029106
TypeName UsePSCredentialTypeForCredentialParams
Severity CriticalError
Type PoShFile

Bad Practice

  function Credential([String]$Credential)
Good Practice
  function Credential

Disclaimer: The views and opinions expressed in this documentation and in SPCAF do not necessarily reflect the opinions and recommendations of Microsoft or any member of Microsoft. SPCAF and RENCORE are registered trademarks of Rencore. All other trademarks, service marks, collective marks, copyrights, registered names, and marks used or cited by this documentation are the property of their respective owners.