$MyInvocation
$MyInvocation.MyCommand.Path------->path and file name of the current script.
$MyInvocation.MyCommand.Name----->the name of a function to identity the current command.
$MyInvocation.MyCommand.Definition-->the complete path of the current script.
    出处:http://cnblogs.com/daishuguang
 
                    
                
 
                
            
         浙公网安备 33010602011771号
浙公网安备 33010602011771号