In my PowerShell module file (.psm1), I am referencing (importing) supporting script files with the code below. In PowerShell version 2.0, in the supporting script file, $MyInvocation.MyCommand.Path is set to the path of the .psm1 file. However in PowerShell version 3, it is $null.
I use this property very extensively to implement test code in the bottom of each of my supporting script files. That way, the test code does not run when the module is imported, but I can still execute the individual script files and test the code inside of them.