Stephanevg/PSHTML

PSHTML

Closed this issue · 4 comments

I'm getting the next error while testing around with PSHTML

Excepción al llamar a "Invoke" con los argumentos "0": "Excepción al llamar a "Invoke" con los argumentos "0": "No se encuentra ningún parámetro que coincida con el
nombre del parámetro 'name'.""
En C:\Program Files\WindowsPowerShell\Modules\PSHTML\0.7.11\PSHTML.psm1: 1456 Carácter: 53

  •                     $outcontent = $Parameters[$($PostKey)].Invoke ...
    
  •                                                 ~~~~~~~~
    
    • CategoryInfo : NotSpecified: (:) [], MethodInvocationException
    • FullyQualifiedErrorId : CmdletInvocationException

I was running the example

html{
Header{
h1 "This is an example generated using PSHTML Templates"
}
Body{

    include -name Body

}
Footer{
    Include -Name Footer
}

}

hi,

Thanks for opening an issue.
this specific example illustrates how to use 'includes'.
Includes is an advznced functionality of pshtml which allows you to reuse chunks of existing pshtmk code by 'including' them at specific parts of your scripts.

if you were just teying ir our, I think you can play with it wihtout 'includes'.
For that, silple replace the whole line 'include -name...' with p{"Hello world"} for example.

If you were really trying to make the example work, it is probably because you don't have the assets files.
For that, you can simple create a 'body.ps1' and 'footer.ps1' $YourmoduleFolder\pshtml\assets \

Let me know if this helps

hi,

Thanks for opening an issue.
this specific example illustrates how to use 'includes'.
Includes is an advznced functionality of pshtml which allows you to reuse chunks of existing pshtmk code by 'including' them at specific parts of your scripts.

if you were just teying ir our, I think you can play with it wihtout 'includes'.
For that, silple replace the whole line 'include -name...' with p{"Hello world"} for example.

If you were really trying to make the example work, it is probably because you don't have the assets files.
For that, you can simple create a 'body.ps1' and 'footer.ps1' $YourmoduleFolder\pshtml\assets \

Let me know if this helps

Thanks for you quick answer. I might be doing something wrong because I'd saved body.ps1 and footer.ps1 in $env:ProgramFiles\WindowsPowerShell\Modules\PSHTML\0.7.11\Assets and runned again the template example and it still prompt the above error.

However your module seems to be very usefull, that's why I would like to keep reading and trying to make me up with it.

It would be awsome to have and generic example of it usage.

Thanks a lot. I'm very grateful for your amazing job.

Thanks for the nice words!
In the module folder of pshtml, there should be a folder called 'examples' which has really a ton of examples in it.
Also, check the Psconfeu github page. I had a talk on Pshtml there which can help you to get started
:)