如何从其他 PowerShell 脚本调用函数并返回对象?
主脚本:
# Run function script
. C:\MySystem\Functions.ps1
RunIE
$ie.Navigate("http://www.stackoverflow.com")
# The Object $ie is not existing
函数脚本:
function RunIE($ie)
{
$ie = New-Object -ComObject InternetExplorer.Application
}