Skip to content

Commit 03c4c3b

Browse files
authored
Merge pull request #21 from JLInF97/snippets
Snippets
2 parents ec1dab8 + 319686d commit 03c4c3b

6 files changed

Lines changed: 122 additions & 9 deletions

File tree

PSWebGui.psd1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ CmdletsToExport = @()
7878
VariablesToExport = '*'
7979

8080
# Alias para exportar desde este módulo; para conseguir el mejor rendimiento, no uses caracteres comodines ni elimines la entrada; usa una matriz vacía si no hay alias que exportar.
81-
AliasesToExport = "Start-PSGUI","Show-PSGUI","Start-GUI","Show-GUI","Show-WebGUI","Start-WebGUI","FH","GTL"
81+
AliasesToExport = "Start-PSGUI","Show-PSGUI","Start-GUI","Show-GUI","Show-WebGUI","Start-WebGUI","FH","SGL"
8282

8383
# Recursos de DSC que se exportarán de este módulo
8484
# DscResourcesToExport = @()
@@ -87,7 +87,7 @@ AliasesToExport = "Start-PSGUI","Show-PSGUI","Start-GUI","Show-GUI","Show-WebGUI
8787
# ModuleList = @()
8888

8989
# Lista de todos los paquetes con este módulo.
90-
FileList = @("Assets\bootstrap.min.css","Assets\panel.png")
90+
FileList = @("Assets\bootstrap.min.css","Assets\panel.png","Snippets\PSWebGui Basic Structure.snippets.ps1xml","Snippets\PSWebGui Login.snippets.ps1xml")
9191

9292
# Datos privados que se pasan al módulo especificado en RootModule/ModuleToProcess. Pueden contener también una tabla hash PSData con metadatos del módulo adicionales usados por PowerShell.
9393
PrivateData = @{
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?xml version='1.0' encoding='utf-8' ?>
2+
<Snippets xmlns='http://schemas.microsoft.com/PowerShell/Snippets'>
3+
<Snippet Version='1.0.0'>
4+
<Header>
5+
<Title>PSWebGui Basic Structure</Title>
6+
<Description>Basic structure for a GUI</Description>
7+
<Author>JLInF97</Author>
8+
<SnippetTypes>
9+
<SnippetType>Expansion</SnippetType>
10+
</SnippetTypes>
11+
</Header>
12+
13+
<Code>
14+
<Script Language='PowerShell' CaretOffset='30'>
15+
<![CDATA[$routes=@{
16+
17+
"/"={
18+
# Here goes your content
19+
}
20+
21+
}]]>
22+
</Script>
23+
</Code>
24+
25+
</Snippet>
26+
</Snippets>
27+
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?xml version='1.0' encoding='utf-8' ?>
2+
<Snippets xmlns='http://schemas.microsoft.com/PowerShell/Snippets'>
3+
<Snippet Version='1.0.0'>
4+
<Header>
5+
<Title>PSWebGui Login</Title>
6+
<Description>Basic login structure with form page and process script</Description>
7+
<Author>JLInF97</Author>
8+
<SnippetTypes>
9+
<SnippetType>Expansion</SnippetType>
10+
</SnippetTypes>
11+
</Header>
12+
13+
<Code>
14+
<Script Language='PowerShell' CaretOffset='0'>
15+
<![CDATA[ "/login"={
16+
Write-CredentialForm -Action "/login/process" -Title "Login form"
17+
}
18+
19+
"/login/process"={
20+
$cred=Get-CredentialForm
21+
Set-GuiLocation -URL "/"
22+
}
23+
]]>
24+
</Script>
25+
</Code>
26+
27+
</Snippet>
28+
</Snippets>
29+

docs/about_PSWebGui.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,16 @@ $_POST["username"]
6565
$_POST["password"]
6666
```
6767

68+
# ISE SNIPPETS
69+
This module has some snippets for using them with **PowerShell ISE**.
70+
71+
To import the snippets in this session, enter the following cmdlet in *PowerShell ISE*:
72+
```powershell
73+
PS> Import-IseSnippet -Module PSWebGui -ListAvailable
74+
```
75+
76+
Or copy them from ```Snippets``` module folder to ```%userprofile%\Documents\WindowsPowerShell\Snippets``` if you want them to be imported every time you open PowerShell ISE
77+
6878
# See also
6979
Reading main function help is recomended
7080
```powershell

en-us/PSWebGui-help.xml

Lines changed: 42 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,12 @@ Tuesday, June 25, 2019 14:53:32</dev:code>
354354
</dev:remarks>
355355
</command:example>
356356
</command:examples>
357-
<command:relatedLinks />
357+
<command:relatedLinks>
358+
<maml:navigationLink>
359+
<maml:linkText>Online version:</maml:linkText>
360+
<maml:uri>https://github.com/JLInF97/PSWebGUI/blob/main/docs/Format-Html.md</maml:uri>
361+
</maml:navigationLink>
362+
</command:relatedLinks>
358363
</command:command>
359364
<command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp">
360365
<command:details>
@@ -404,7 +409,12 @@ Administrator System.Security.SecureString</dev:code>
404409
</dev:remarks>
405410
</command:example>
406411
</command:examples>
407-
<command:relatedLinks />
412+
<command:relatedLinks>
413+
<maml:navigationLink>
414+
<maml:linkText>Online version:</maml:linkText>
415+
<maml:uri>https://github.com/JLInF97/PSWebGUI/blob/main/docs/Get-CredentialForm.md</maml:uri>
416+
</maml:navigationLink>
417+
</command:relatedLinks>
408418
</command:command>
409419
<command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp">
410420
<command:details>
@@ -485,7 +495,12 @@ Administrator System.Security.SecureString</dev:code>
485495
</dev:remarks>
486496
</command:example>
487497
</command:examples>
488-
<command:relatedLinks />
498+
<command:relatedLinks>
499+
<maml:navigationLink>
500+
<maml:linkText>Online version:</maml:linkText>
501+
<maml:uri>https://github.com/JLInF97/PSWebGUI/blob/main/docs/Set-GuiLocation.md</maml:uri>
502+
</maml:navigationLink>
503+
</command:relatedLinks>
489504
</command:command>
490505
<command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp">
491506
<command:details>
@@ -566,7 +581,12 @@ Administrator System.Security.SecureString</dev:code>
566581
</dev:remarks>
567582
</command:example>
568583
</command:examples>
569-
<command:relatedLinks />
584+
<command:relatedLinks>
585+
<maml:navigationLink>
586+
<maml:linkText>Online version:</maml:linkText>
587+
<maml:uri>https://github.com/JLInF97/PSWebGUI/blob/main/docs/Set-Title.md</maml:uri>
588+
</maml:navigationLink>
589+
</command:relatedLinks>
570590
</command:command>
571591
<command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp">
572592
<command:details>
@@ -905,7 +925,12 @@ Administrator System.Security.SecureString</dev:code>
905925
</dev:remarks>
906926
</command:example>
907927
</command:examples>
908-
<command:relatedLinks />
928+
<command:relatedLinks>
929+
<maml:navigationLink>
930+
<maml:linkText>Online version:</maml:linkText>
931+
<maml:uri>https://github.com/JLInF97/PSWebGUI/blob/main/docs/Show-PSWebGUI.md</maml:uri>
932+
</maml:navigationLink>
933+
</command:relatedLinks>
909934
</command:command>
910935
<command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp">
911936
<command:details>
@@ -959,7 +984,12 @@ Administrator System.Security.SecureString</dev:code>
959984
</dev:remarks>
960985
</command:example>
961986
</command:examples>
962-
<command:relatedLinks />
987+
<command:relatedLinks>
988+
<maml:navigationLink>
989+
<maml:linkText>Online version:</maml:linkText>
990+
<maml:uri>https://github.com/JLInF97/PSWebGUI/blob/main/docs/Show-PSWebGUIExample.md</maml:uri>
991+
</maml:navigationLink>
992+
</command:relatedLinks>
963993
</command:command>
964994
<command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp">
965995
<command:details>
@@ -1242,6 +1272,11 @@ Administrator System.Security.SecureString</dev:code>
12421272
</dev:remarks>
12431273
</command:example>
12441274
</command:examples>
1245-
<command:relatedLinks />
1275+
<command:relatedLinks>
1276+
<maml:navigationLink>
1277+
<maml:linkText>Online version:</maml:linkText>
1278+
<maml:uri>https://github.com/JLInF97/PSWebGUI/blob/main/docs/Write-CredentialForm.md</maml:uri>
1279+
</maml:navigationLink>
1280+
</command:relatedLinks>
12461281
</command:command>
12471282
</helpItems>

en-us/about_PSWebGui.help.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,18 @@ $_GET AND $_POST VARIABLES
7474
$_POST["username"]
7575
$_POST["password"]
7676

77+
ISE SNIPPETS
78+
This module has some snippets for using them with PowerShell ISE.
79+
80+
To import the snippets in this session, enter the following
81+
cmdlet in PowerShell ISE:
82+
83+
PS> Import-IseSnippet -Module PSWebGui -ListAvailable
84+
85+
Or copy them from "Snippets" module folder to
86+
"%userprofile%\Documents\WindowsPowerShell\Snippets"
87+
if you want them to be imported every time you open PowerShell ISE
88+
7789
SEE ALSO
7890
Reading main function help is recomended
7991

0 commit comments

Comments
 (0)