The use of the AsPlainText parameter with the ConvertTo-SecureString command can expose secure information.
+ ++If you do need an ability to retrieve the password from somewhere without prompting the user, consider using the SecretStore module from the PowerShell Gallery. +
+The names of computers should never be hard coded as this will expose sensitive information. The ComputerName parameter should never have a hard coded value.
+
Remove hardcoded computer names.
+ ++You cannot use following reserved characters in a function or cmdlet name as these can cause parsing or runtime errors. + +Reserved Characters include: #,(){}[]&/\\$^;:\"'<>|?@`*%+=~ +
+ +Remove reserved characters from names.
+ +To standardize command parameters, credentials should be accepted as objects of type PSCredential. Functions should not make use of username or password parameters.
+
Change the parameter to type PSCredential.