I frequently use comment based help in PowerShell and it always worked fabulous. However, today I encountered an issue.
If I use Get-Help Test.ps1 I get on some systems if the file is in some locations the following error, after "Searching for Help Test.ps1" popped up:
Get-Help : Get-Help could not find Test.ps1 in a help file in this session. To download updated help topics type: "Update-Help". [...]
The strange thing is: On my client, it doesn't work on local drives or one network share. But the help works for the very same file on another network share.
By now, all I can say is, that the comment based help is functional and does not contain any syntax errors, otherwise it wouldn't work on any machine. Also: Execution of the scrip works always.
Nothing comes directly in mind.
Can you look at each of those destinations, the $env:psmodulepath and the general Path environment variable for any visible differences ?
Path variables were different, but just as expected, nothing to do with the paths where Get-Help was working or not.
So actually I just figured that issue out and in fact it was my own fault. 🙂 So, on one machine AppLocker Software Restriction policies are enabled and depending on the user context and path I was not able to execute the script and therefore the help was not working too. On the other machine I didn't have AppLocker enabled, but unfortunately I made a mistake in the script. I write a log file with the same name of the script during the runtime. I forgot to add an extension like .log, therefore the log was written directly in the PowerShell script. So I first executed the script successfully and tried the help after this. In the meanwhile my script was edited from its self which damaged the script and therefore the help. D'oh!
You must be logged in to reply to this topic.