Help alias

Topics: User Forum
May 18, 2009 at 12:17 AM

Fwiw, with the new 1.2 version of pscx on Win7 RC, when I enter "help <some command>" I get the following:

PS \\DAVESWIN7\C:\Users\Dave> help get-help
Cannot resolve alias 'help' because it refers to term 'Get-PagedHelp', which is
 not recognized as a cmdlet, function, operable program, or script file. Verify
 the term and try again.
At line:1 char:5
+ help <<<<  get-help
    + CategoryInfo          : ObjectNotFound: (help:String) [], CommandNotFoun
   dException
    + FullyQualifiedErrorId : AliasNotResolvedException

PS \\DAVESWIN7\C:\Users\Dave>

Coordinator
May 18, 2009 at 11:56 PM

Did you use the ZIP'd PSCX module or the MSI?

May 19, 2009 at 12:47 AM

Intially I tried to import the unzipped module but failed probably due to my doing it wrong so then ran the msi which seemed to work fine.

Coordinator
May 19, 2009 at 5:32 PM

So are you still seeing this problem after installing the MSI?  Or did you only see this with the Module?

May 19, 2009 at 6:58 PM

Yes, I still see this error after having run the .msi file though as I said, I did try the unzip and import which did not work, before I tried the msi method of install which did [see my other post]. Other stuff such as write-zip works fine but I have not tested a lot. Thanks, Dave

Coordinator
May 20, 2009 at 1:08 AM

Can you execute this command to see if the Get-PagedHelp.ps1 file exists where it is supposed to?

test-path $pscx:ScriptsDir\Get-PagedHelp.ps1

May 20, 2009 at 3:46 AM

This is the output I get:

PS \\DAVESWIN7\C:\Users\Dave>test-path $pscx:ScriptsDir\Get-PagedHelp.ps1
True
PS \\DAVESWIN7\C:\Users\Dave>

Also. fwiw, "get-help" and "get-help get-help" work fine and "help" all by itself gets the error message below. On my Vista and Server 2008 systems, both PS version 1, "help" shows the alias definitions.

PS \\DAVESWIN7\C:\Users\Dave>help
Cannot resolve alias 'help' because it refers to term 'Get-PagedHelp', which is
 not recognized as a cmdlet, function, operable program, or script file. Verify
 the term and try again.
At line:1 char:5
+ help <<<<
    + CategoryInfo          : ObjectNotFound: (help:String) [], CommandNotFoun
   dException
    + FullyQualifiedErrorId : AliasNotResolvedException

PS \\DAVESWIN7\C:\Users\Dave>

Coordinator
May 20, 2009 at 6:26 AM

It seems it can't find Get-PagedHelp.ps1 via the path.  When the PSCX snapin is loaded it is supposed to modify the PATH env var within the PowerShell process to add the PSCX scripts dir to the path.  Can you execute the following and see if the path C:\Program Files\PowerShell Community Extensions\Scripts is listed?

PS> Get-PathVariable Path

BWT, thanks for all your help.

May 20, 2009 at 7:08 AM

Well that was the root of the problem. Apaprently profile.ps1 runs before Microsoft.PowerShell_profile.ps1 where I had a bug and wiped out the pscx path. First time I edited the file though things got a lot worse till I figured out that textpad.exe was saving my profile in Unicode which PS did not like at all [not sure why it switched to Unicode all of a sudden asn I had been using no problem]. That was a surprise as I got tons of errors about ' ' characters and everything started working after I saved my corrected profile as UTF8. Should PS recognize Unicode scripts? Sorry for the bother when this was all my fault! Thanks for your help! Dave

Coordinator
May 20, 2009 at 3:48 PM

No problem.  I'm glad we got to the bottom of it all.