Powershell 脚本调用方法

方法一: 

Get-Content "D:PowershellScriptsTestErrorMailNotice.ps1" | Invoke-Expression

 

方法二:

$script = "D:PowershellScriptsTestErrorMailNotice.ps1"

.$script

 

原文地址:https://www.cnblogs.com/thescentedpath/p/invokeexpression.html