Closed
Description
In about_Requires, we need to add a line explaining that this directive runs first in the script, even when it doesn't appear on the first line in the script.
#Requires
is supposed to be the first line in the script (as doc'd). But, if it's not, there's no error. Instead, it runs first without warning. Therefore, code like this, in which order matters, fails unexpectedly, because the correct version of the module is imported, then removed.
Get-Module Pester | Remove-Module #Removes current version
#Requires -Module @{ModuleName = 'Pester'; ModuleVersion = '3.4.3'}
...