方法一:
Get-Content "D:\PowershellScripts\Test\ErrorMailNotice.ps1" | Invoke-Expression
方法二:
$script = "D:\PowershellScripts\Test\ErrorMailNotice.ps1"
.$script
方法一:
Get-Content "D:\PowershellScripts\Test\ErrorMailNotice.ps1" | Invoke-Expression
方法二:
$script = "D:\PowershellScripts\Test\ErrorMailNotice.ps1"
.$script
转载于:https://www.cnblogs.com/thescentedpath/p/invokeexpression.html