Menu

#134 Building Convert-HelpToHtmlTree over network might corrupt the build

v1.2.07
open
nobody
None
1
2015-10-21
2015-09-28
No

Building a HTML Tree might not work correctly when the NameSpace is located on a network share.

Providing a custom path to make user the source is from a local disk using a paramater -NameSpacePath will take care of such issues.

    Param(
        [parameter(Mandatory=$true)][String[]]$NameSpaces,
        [string]$NameSpacePath,
        [string]$TargetDir    = ".",
        [string]$TemplateName = "",
        [string]$DocTitle     = "",
        [string]$Copyright    = "",
        [string]$RevisionDate = "",
        [int]$OutputWidth     = $host.UI.RawUI.BufferSize.Width
    )

The $NameSpacePath must be uncluded in $env:PSModulePath if used.
And if not provided, the standard user module path has to be used.

    if (!$NameSpacePath) # go for the standard user path
        { $script:ModulePath = Get-UserPsModulePath }
        elseif (!(($env:PSModulePath).Contains($NameSpacePath))) # ModulePath wasn't added before
            {$env:PSModulePath = $env:PSModulePath + ";$NameSpacePath"}

Replace all occurences of PSModulePath in the .psm1 with $NameSpacePath

Discussion

  • Dennis Lindqvist

    Where is the edit feature of the tickets :/

    Building a HTML Tree might not work correctly when the NameSpace is located on a network share.

    Building a HTML Tree might not work correctly when the NameSpace is located in a network synced folder.

    Providing a custom path to make user the source is from a local disk using a paramater -NameSpacePath will take care of such issues.

    Providing a custom root path to make sure the namespace source is from a local disk using a paramater -NameSpaceRoot will take care of such issues.

    The $NameSpacePath must be uncluded in $env:PSModulePath if used.

    The $NameSpaceRoot must be included in $env:PSModulePath if used.

        if (!$NameSpaceRoot) # go for the standard user path
            { $script:NameSpaceRoot = Get-UserPsModulePath }
            elseif (!(($env:PSModulePath).Contains($NameSpaceRoot))) # NameSpaceRoot wasn't added before
                {$env:PSModulePath = $env:PSModulePath + ";$NameSpaceRoot"}
    

    Replace all occurences of PSModulePath in the .psm1 with $NameSpacePath

    Replace all occurences of Get-UserPsModulePath in the .psm1 with $NameSpaceRoot

     

    Last edit: Dennis Lindqvist 2015-09-29
  • Michael Sorens

    Michael Sorens - 2015-09-30

    Thanks for your detailed bug reports--and proposed code fixes!

    As far as editing... I think I have now added permissions for you to be able to edit your posts... let me know if it works.

    For this issue, I have adapted your code fragment and integrated it into the file attached. Try it out and let me know if it works for your situation.

     
  • Dennis Lindqvist

    Thanks Michael,
    I've always been able to edit my posts, not just the actual ticket.

    I do have a couple of new options in all posts (not just my own).
    I don't feel comfortable with beeing able to edit or delete your posts as well though ;)

     

    Last edit: Dennis Lindqvist 2015-10-01
  • Dennis Lindqvist

    The 134-fix killed my PoSH console.

    I do have a version of my own with these fixes that is working (see attachment).

     

    Last edit: Dennis Lindqvist 2015-10-01
  • Michael Sorens

    Michael Sorens - 2015-10-21

    Dennis:
    Sorry, thought I replied to this earlier...
    While I would like to incorporate improvements, when I did a diff on your file it shows the entire file overhauled so there's no way I can see just the substance of what you changed...
    Also, any notion of why my file did not work for you?

     

Log in to post a comment.