I have a function that i would like to not load if WebAdministration module is not present as it relies on that being installed as part of IIS.
At the top of the function I have added
#Requires -Module WebAdministration
However it appears to load and partially load before it hits a trap i have within the function then it exits.
Am i wrong of shouldn’t the require statement perform a check at load time for the specified module, if not found close? We are on PS 5.1 currently.
Thank you for any clarification i may miss.