13

Trying to retrieve help from a script gives the following error:

Get-Help : Cannot find Help for topic ".\Process-Test.ps1".
At line:1 char:9
+ get-help <<<<  .\Process-Test.ps1
    + CategoryInfo          : ResourceUnavailable: (:) [Get-Help], HelpNotFoundException
    + FullyQualifiedErrorId : HelpNotFound,Microsoft.PowerShell.Commands.GetHelpCommand

I've encountered the same error when attempting to retrieve help information from any custom PowerShell script. This does not happen when viewing help information from built-in cmdlets.

A test script is below:

<#
    .SYNOPSIS 
    Adds a file name extension to a supplied name.

    .DESCRIPTION
    Adds a file name extension to a supplied name. 
    Takes any strings for the file name or extension.

    .EXAMPLE
    C:\PS> extension -name "File"
    File.txt
#>

Write-Host "Test script"

Troubleshooting steps I've taken:

  • I've copied this script (or similar scripts) to other machines with PowerShell installed and used it to view help successfully.
  • I've also been able to view the help using a different account (User2) on my computer successfully, but only when logged in as the other user (versus running the PowerShell console as User2 when logged in as User1).
  • I've tried viewing the help with and without my PowerShell profile loaded, with the same result (I only have one profile loaded, my personal profile versus machine profiles).
  • I took this to be a sign that there was a problem with my Windows user profile, so I deleted my profile and re-created it with the same result. I've also tried running System Restore, with no change.
  • This happens in the PowerShell console along with the ISE.
  • Occurs when using both Get-Help as well as help.

I noticed, however, that my PowerShell console settings stayed consistent throughout deleting and re-creating my Windows user profile (height, width, colors, etc), which I wouldn't have expected since I deleted my user profile.

Since I'm using Windows 7, I'm not able to uninstall PowerShell and re-install as it's baked into the OS.

Google wasn't helpful for me in this case, but my google skills could be lacking. Any ideas as to further troubleshooting steps, or anyone who's seen this error before?

Edit: this only happens with the 64-bit version of the console and ISE, not with the 32-bit version, and persists through profile deletion

5
  • I just ran it on my machine and it worked. Have you tried creating a new user on the machine with the problem? Commented Jan 15, 2012 at 7:07
  • If something got dorked up in the PowerShell directory, you could copy a PowerShell directory from a working machine and run folder diffmerge on it to see if any files are different. Commented Jan 15, 2012 at 7:14
  • As part of the troubleshooting steps I was able to get help when logged in as a different user on the problem machine. I can't create a new user account however as its a work laptop, although I have access to two different accounts. Commented Jan 15, 2012 at 7:16
  • Ah, yea that's odd. Deleting your profile should of wiped out your C:\users\user directory and included HKCU registry hive. Commented Jan 15, 2012 at 7:22
  • Used diffmerge to compare the PowerShell directory on the problem machine with a known good machine, the only differences are due to installed RSAT tools/added features. Commented Jan 15, 2012 at 7:38

2 Answers 2

5

Have you tried to set execution policy?

Set-ExecutionPolicy -ExecutionPolicy remotesigned -Scope process

Then do Get-Help .\script.ps1.

Sign up to request clarification or add additional context in comments.

2 Comments

The .\ was what was missing for me.
For me it was the Set-ExecutionPolicy, and since I'm targeting restricted environment, I have to write powershell -ExecutionPolicy Bypass -Command Get-Help .\script.ps1
2

I had the same problem. That was because my script was located on a networkshare in a DFS folder. So I am pointing to network file. When I copied the file locally, directly on the root of my C drive, and called the help option for my script with the normal get-help myscript.ps1 parameter, it worked!

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.