Quantcast
Channel: SQLServerCentral » Programming » Powershell » Latest topics
Viewing all articles
Browse latest Browse all 467

SQLPS takes 30 minutes to import. How to fix it?

$
0
0
Hey SSC,SQLPS on my workstation used to take around 30 seconds to import. Not exactly speed-of-thought, but acceptable.Now it takes around 30 minutes! This is unacceptable because it blocks my spontaneous PowerShell queries.What could have changed to make the module so unbearably slow to load?The ISE debugger has helped me to narrow down the cause, but not enough to say what the problem is or how to fix it.In a new instance of ISE I open a one-line script to import the module.[code="plain"]Import-Module SQLPS[/code]I set a breakpoint on the line and start debugging.I press 's' repeatedly at the prompt to step into every subsequent breakpoint until the module has loaded.The debugger seems to skip some lines. I'm not sure I'm getting the whole picture, but I carry on.Between this line in Sqlps.ps1:[code="plain"]Set-Variable -scope Global -name SqlServerMaximumTabCompletion -Value 1000[/code]and this line in SqlPsPostScript.ps1:[code="plain"]Set-Location SQLSERVER:[/code]I have to wait a very long time.Just before the debugger returns control, it produces this output.[code="plain"]WARNING: The local computer does not have an active instance of Analysis Services.[/code]The warning about Analysis Services could be misleading. Analysis Services has never been installed on my workstation. The warning appeared when performance was still fast enough. How can I track down the true source of the problem and fix it?Thanks!

Viewing all articles
Browse latest Browse all 467

Trending Articles