Powershell Comment Based help not working : get-help : Get-Help could not find

Anonymous
2024-09-18T13:20:22+00:00

I am trying to implement comment based help in my scripts but randomly some of htem don't work. Here's an excert of one:

<#

    .SYNOPSIS

         This script will modify permissions ona  shared mailbox

    .DESCRIPTION

    This script will modify the permissions on a Shared Mailbox. 

    1. It will require a connection to Exchange Online

    2. It will require a list of mailboxes to Add or Delete

    .PARAMETER SharedMailbox

    Mandatory. The Email address of the Shared Mailbox

    .PARAMETER Add

    The list of mailboxes to grant full access and send as permissions. 

        In this format - "@dfo-mpo.gc.ca","@dfo-mpo.gc.ca"

    .PARAMETER Remove

    The list of mailbox to remove full access and send as permissions. 

        In this format - "@dfo-mpo.gc.ca","@dfo-mpo.gc.ca"

    .EXAMPLE

    PS C:\&gt; SharedMailboxPer.ps1 -SharedMailbox "******@dfo-mpo.gc.a" -Add "******@dfo-mpo.gc.ca","******@dfo-mpo.gc.ca" -Remove "******@dfo-mpo.gc.ca

#>

    [cmdletBinding()]

    param (

    [Parameter(Mandatory=$True)]

    [String]$SharedMailbox,

    $Add,

    $Remove

    )

When I try a get-help SharedMailboxPerm.ps1 i get the following error:

get-help : Get-Help could not find SharedMailboxPerm.ps1 in a help file in this session. To 

download updated help topics type: "Update-Help". To get help online, search for the help 

topic in the TechNet library at https:/go.microsoft.com/fwlink/?LinkID=107116.

At line:1 char:1

+ get-help SharedMailboxPerm.ps1

+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : ResourceUnavailable: (:) [Get-Help], HelpNotFoundException

    + FullyQualifiedErrorId : HelpNotFound,Microsoft.PowerShell.Commands.GetHelpCommand

The script is in the path (autocomplete works from the ISE) and it works for other scripts. I am at a loss for this one.

Windows for business Windows Server User experience PowerShell

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question. To protect privacy, user profiles for migrated questions are anonymized.

0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Anonymous
    2024-09-19T01:27:06+00:00

    Hi,

    Thanks for your post.

    It seems SharedMailboxPerm.ps1 cannot be found by PowerShell. Try using the full path of the file

    Get-Help C:\Folder\SharedMailboxPerm.ps1
    

    or adding the path to $env:PATH.

    $env:PATH += C:\Folder
    
    0 comments No comments
  2. Anonymous
    2024-09-19T10:50:16+00:00

    Thanks, but I figured it out. I had an error in the script so it would parse it correctly. It must have been Second Monday... :)

    0 comments No comments