0
我在当前的PowerShell会话中创建了function
。现在我想保存它以备后用。怎么样?从当前会话导出功能
例如,我如何在随后的会话中使用它?
function xfirefox {
Start-Process firefox.exe $args
}
我知道我只是把它放到我的profile
。我希望能够运行类似Export-Function xfirefox myFunctions.txt
的东西。
你需要建立一个配置文件并保存它http://blogs.technet.com/b/heyscriptingguy/archive/2012/05/21/understanding-the-six-powershell-profiles.aspx – Matt 2014-10-10 00:52:57