Sql-server – Cannot start SQL Server PowerShell

powershellsql serversql-server-2008

Have you guys had this problem where, when you start PowerShell from SQL Server, it throws an exception like the following?

Cannot resolve alias 'cd' because it
refers to term
'Microsoft.PowerShell.Manag
ement\Set-Location', which is not
recognized as a cmdlet, function,
operable pr ogram, or script file.
Verify the term and try again. At
line:1 char:140
+ &{[System.Console]::Title = 'SQL Server Powershell';Convert-UrnToPath
'Server
[@Name=''AIMLESS'']/Database[@Name=''AdventureWorks2008'']'|cd
<<<< }

I cannot navigate around with some common aliases like pwd, cd, etc.. even though get-alias clears shows that cd is set-location and pwd is get-location.

alt text

[UPDATE] Alias cannot be set either
alt text

Best Answer

I'm pretty sure I ran across this several months ago, but can't find it anymore after a quick search. I believe the user's GAC some how got corrupted/mixed up.

Are you able to start a regular PowerShell session OK?

How you updated .NET versions?