Closed juneb closed 4 years ago
Hi, thanks for your PR. I will look into this before our next release.
According to @austoonz , the WarningPreference preference variable will suppress this warning, but because we implemented it through ScriptsToProcess, the WarningAction common parameter cannot suppress the message. I'll cancel this PR and look for other ways to improve this experience.
Description
Added CmdletBinding attribute to the script and the function. This is a best practice that makes the script and the function behave like PowerShell cmdlets. Among the many benefits, the script and function now support PowerShell common parameters.
Motivation and Context
Without these changes, users can't use the WarningAction parameter to suppress the warning in the function. This is really annoying because it appears even when the Import-Module command completely specifies an AWSPowerShell module variant.
Also, the warning is incomprehensible to most users (what is a "monolithic variant?"), so it's not helpful. I'll file a PR to fix the warning, but this is a good start.
Testing
Local test that used several common parameters and verified that they were effective in the function.
Screenshots (if appropriate)
Types of changes
Checklist
License