我想在 600 台 Window XP 计算机上安装 PowerShell,并将其用作主要处理 shell。例如,用于替换批处理脚本、VB 脚本和其他一些小程序。安装过程没有问题。我认为我会遇到的一些问题是:
更改权限以允许 PowerShell 运行脚本
PowerShell启动速度
将 PowerShell 用于带有 GPO 的登录/注销脚本
问题 2:有一个本应加速 PowerShell 的脚本,但它似乎需要以管理员身份运行(这当然不是普通用户可以做的事情)。 有没有人有过以这种方式使用 PowerShell 的经验?
最佳答案
为了加速 PowerShell 的启动,Jeffrey Snover(负责 PowerShell 的合作伙伴/架构师)提供了一个“Update-GAC”脚本 here .
基本上,它只是运行通过为 PowerShell 和 NGen'ing(将 IL 预编译为机器代码)加载的程序集。这确实加快了 PowerShell 的启动速度。
另一个技巧是使用 -nologo 和 -noprofile 开关运行 PowerShell。
这将跳过配置文件脚本和启动 Logo 。
有一个product for using PowerShell for logon/logoff scripts来自特种作战软件。还有其他方法可以做到这一点。
%windir%\system32\WindowsPowerShell\v1.0\powershell.exe -nologo -noprofile
关于configuration - 在 600 台客户端计算机上安装 PowerShell - 推荐设置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/113664/