To speed up the start of PowerShell, Jeffrey Snover (the partner/architect responsible for PowerShell) provides an “Update-GAC” script here.
Basically, it is just running through the assemblies that are loaded for PowerShell and NGen’ing (pre-compiling the IL to machine code) them. This does speed up the start of PowerShell.
Another trick is to run PowerShell with the -nologo and -noprofile switches.
This will skip the profile scripts and splash logo.
There is a product for using PowerShell for logon/logoff scripts from Special Operations Software. There are other ways to do it also.
%windir%system32WindowsPowerShellv1.0powershell.exe -nologo -noprofile
Changing permissions to allow Powershell scripts is possible to do via group policy.
Microsoft provide ADM templates here, there is only one option “Turn on Script Execution” and can be assigned at a user or computer level.
It seems it’s possible to run poweshell silently, but not just by calling itself. This article has more information.
So answering my own questions
- This can be done via GPOs
- First run takes at least 10 seconds
on our computers. this could add
that time onto the logon time which
- This seems fairly simple to do, using the
scripts above is invisibility is
needed, or by calling the powershell
exe and passing it startup options.
On our computers, to use powershell for logon seems not to be worthwhile just because of the logon time increase.