Import-Module for advanced functions doesn’t work as expected
Using [CmdletBinding(SupportShouldProcess)] on functions using them inside the main script does work as expected: When passing -WhatIf or -Confirm:$true to the script then those parameters are passed to the advanced function too.
However when moving those function into a module (Example: Tools.psm1) the function is imported and can be called but those parameters are NOT passed to that function.
Any ideas are welcome.
Kind Regards,
Thomas
Using [CmdletBinding(SupportShouldProcess)] on functions using them inside the main script does work as expected: When passing -WhatIf or -Confirm:$true to the script then those parameters are passed to the advanced function too. However when moving those function into a module (Example: Tools.psm1) the function is imported and can be called but those parameters are NOT passed to that function. Any ideas are welcome. Kind Regards,Thomas Read More