When opening either powershell or powershell ISE it take easily over a minute for either to be ready to use. I will also be very slow running commands. something as simple as Get-PSDrive takes at least a minute or more to run.
I am currently running Win 7 x64. PSshell version 5…0.10514.6
Check your $profile file. See if there’s any functions trying to load at start up.
Also check $env:PSModulePath and see if you a network paths in there. That slows down PowerShell and intellisense a lot.
thank you for the response.
I checked my Profile file and there was nothing but a command to set dir to C:. I just deleted it.
$env:PSModulePath returns C:\user\xxxxx\documents\WindowsPowershell\modules:C:\Windows\system32\windowspowershell\v1.0\modules
Power shell still running very slow.
Since I am running x64 bit should the path be windows\WOW64\Windowspowershell\v1.0\module ?
How many modules do you have installed?
get-module shows only 4 installed modules.
What about your .NET install? not sure but since PowerShell depends/uses the .NET framework maybe something is funky there.
Did you check all 4 profiles?
Description Path
Current User, Current Host $Home[My ]Documents\WindowsPowerShell\Profile.ps1
Current User, All Hosts $Home[My ]Documents\Profile.ps1
All Users, Current Host $PsHome\Microsoft.PowerShell_profile.ps1
All Users, All Hosts $PsHome\Profile.ps1
What does Get-Module -ListAvailable show?
Ivan I am now running MS .net framework 4.6.2. Tried upgrading and it did not help.
Rob all modules are in C:\Windows\system32\windowspowershell\v1.0\modules
two are Manifest and one is Script
Will Get-Module -ListAvailable shows 2 modules in Directory: C:\Program Files\WindowsPowerShell\Modules
and 23 in Directory: C:\Windows\system32\WindowsPowerShell\v1.0\Modules
Are you using roaming profiles?
Also, try downloading PowerShell v6 and see how that behaves on your machine.
Ben
I am not using roaming profiles.
Can Windows 7 run powershell V6? I see downloads for Windows 8.1 and 10 but not 7.
I was asking if you had looked at all the potential profile files. Not the modules.
I had a similar issue. I used process monitor and determined it was because I was using PowerShell transcript logging and PowerShell wasn’t able to reach the logging server. When I deactivated the logging, PowerShell returned to quick start up.
Removed a bit of output for clarity.
4:49:38.5598938 PM powershell.exe 10552 CreateFile C:\Windows\CSC\v2.0.6\namespace\SERVER NAME NOT FOUND 4:49:59.2770204 PM powershell.exe 10552 CreateFile C:\Windows\CSC\v2.0.6\namespace\SERVER NAME NOT FOUND 4:49:59.2770849 PM powershell.exe 10552 CreateFile \\SERVER\powershelllogging$\20170801\PowerShell_transcript.Computer.3Rk9SPVM.20170801164854.txt IO TIMEOUT 4:50:40.7241605 PM powershell.exe 10552 CreateFile C:\Windows\CSC\v2.0.6\namespace\SERVER NAME NOT FOUND 4:50:56.1804549 PM powershell.exe 10552 Thread Exit SUCCESS Thread ID: 8248, User Time: 0.0000000, Kernel Time: 0.0000000 4:51:22.1649146 PM powershell.exe 10552 CreateFile C:\Windows\CSC\v2.0.6\namespace\SERVER NAME NOT FOUND 4:51:22.1649745 PM powershell.exe 10552 CreateFile \\SERVER\powershelllogging$\20170801\ IO TIMEOUT 4:52:03.5742313 PM powershell.exe 10552 CreateFile C:\Windows\CSC\v2.0.6\namespace\SERVER NAME NOT FOUND
Can see if logging via
Get-Item HKLM:\SOFTWARE\Policies\Microsoft\Windows\PowerShell\Transcription
I have the same issue.Hope I can solve it.