From 52bbad40c1d1c90454e673ce1e9fa1dac374ad01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw=20K=C5=82ys?= Date: Mon, 7 Sep 2026 17:26:15 +0200 Subject: [PATCH 1/3] Make PSWriteHTML examples portable --- Docs/New-HTMLFrame.md | 6 +++--- Examples/Example-GenerateHelp.ps1 | 4 ++-- Examples/Example-GenerateHelpCalendar.ps1 | 4 ++-- .../Example-InlineHTML01.ps1 | 8 ++++---- Examples/Example-Table/Example7_02_DataStoreJava.ps1 | 2 +- Examples/Example39-TableColumnOption/Example39_01.ps1 | 2 +- .../Example41-Navigation01/Example41-Navigation01.ps1 | 6 +++--- Private/Parameters.Configuration.ps1 | 2 -- Public/New-HTMLFrame.ps1 | 8 ++++---- 9 files changed, 20 insertions(+), 22 deletions(-) diff --git a/Docs/New-HTMLFrame.md b/Docs/New-HTMLFrame.md index 9255019b..e60cdc2b 100644 --- a/Docs/New-HTMLFrame.md +++ b/Docs/New-HTMLFrame.md @@ -23,13 +23,13 @@ Allows to inline other HTML files into the current HTML file. This can be useful ```powershell New-HTML { New-HTMLSection { - New-HTMLFrame -SourcePath "$PSSCriptRoot\GPOZaurr.html" -Scrolling Auto + New-HTMLFrame -SourcePath (Join-Path -Path $PSScriptRoot -ChildPath 'GPOZaurr.html') -Scrolling Auto } -HeaderText 'Test' New-HTMLSection { - New-HTMLFrame -SourcePath "$PSSCriptRoot\GPOZaurr.html" -Scrolling Auto -Height 1500px + New-HTMLFrame -SourcePath (Join-Path -Path $PSScriptRoot -ChildPath 'GPOZaurr.html') -Scrolling Auto -Height 1500px } -HeaderText 'Test' New-HTMLSection { - New-HTMLFrame -SourcePath "C:\Support\GitHub\PSWriteHTML\Examples\Example-Maps\Example-Maps.html" + New-HTMLFrame -SourcePath (Join-Path -Path $PSScriptRoot -ChildPath 'Example-Maps/Example-Maps.html') } -HeaderText 'Test' -Height 100vh } -Online -TitleText 'Test Inline' -ShowHTML -FilePath "$PSScriptRoot\Example-InlineHTML01.html" -AddComment ``` diff --git a/Examples/Example-GenerateHelp.ps1 b/Examples/Example-GenerateHelp.ps1 index 5dbc6a2d..cc5f7040 100644 --- a/Examples/Example-GenerateHelp.ps1 +++ b/Examples/Example-GenerateHelp.ps1 @@ -45,11 +45,11 @@ New-HTML -TitleText 'This is a test' -FilePath "$PSScriptRoot\..\ShowMe.html" { New-HTMLSection { New-HTMLTree -Checkbox none { New-HTMLTreeChildCounter -Deep -HideZero -HideExpanded - New-HTMLTreeFileNodes -Path 'C:\Support\GitHub\PSWriteHTML\Examples' -Filter *.html -IsExpanded + New-HTMLTreeFileNodes -Path $PSScriptRoot -Filter *.html -IsExpanded } -EnableChildCounter -AutoScroll New-HTMLSection -Invisible { New-HTMLFrame -Name 'contentFrame' -Scrolling Auto -Height 550px } } } -} -Online -ShowHTML \ No newline at end of file +} -Online -ShowHTML diff --git a/Examples/Example-GenerateHelpCalendar.ps1 b/Examples/Example-GenerateHelpCalendar.ps1 index 189af453..568e135b 100644 --- a/Examples/Example-GenerateHelpCalendar.ps1 +++ b/Examples/Example-GenerateHelpCalendar.ps1 @@ -1,6 +1,6 @@ Import-Module .\PSWriteHTML.psd1 -Force -$Files = Get-ChildItem -Path 'C:\Support\GitHub\PSWriteHTML\Examples' -Filter *.html -Recurse +$Files = Get-ChildItem -Path $PSScriptRoot -Filter *.html -Recurse New-HTML -TitleText 'This is a test' -FilePath "$PSScriptRoot\ShowMeCalendar.html" { New-HTMLSection -Invisible { @@ -29,4 +29,4 @@ New-HTML -TitleText 'This is a test' -FilePath "$PSScriptRoot\ShowMeCalendar.htm New-HTMLSection -Invisible { New-HTMLFrame -Name 'contentFrame' -Scrolling Auto -Height 1500px } -} -Online -ShowHTML \ No newline at end of file +} -Online -ShowHTML diff --git a/Examples/Example-InlineOtherHTMLFile.ps1/Example-InlineHTML01.ps1 b/Examples/Example-InlineOtherHTMLFile.ps1/Example-InlineHTML01.ps1 index 03f5dcb9..31d3d678 100644 --- a/Examples/Example-InlineOtherHTMLFile.ps1/Example-InlineHTML01.ps1 +++ b/Examples/Example-InlineOtherHTMLFile.ps1/Example-InlineHTML01.ps1 @@ -2,13 +2,13 @@ New-HTML { New-HTMLSection { - New-HTMLFrame -SourcePath "$PSSCriptRoot\GPOZaurr.html" -Scrolling Auto + New-HTMLFrame -SourcePath (Join-Path -Path $PSScriptRoot -ChildPath 'GPOZaurr.html') -Scrolling Auto } -HeaderText 'Test' New-HTMLSection { - New-HTMLFrame -SourcePath "$PSSCriptRoot\GPOZaurr.html" -Scrolling Auto -Height 1500px + New-HTMLFrame -SourcePath (Join-Path -Path $PSScriptRoot -ChildPath 'GPOZaurr.html') -Scrolling Auto -Height 1500px } -HeaderText 'Test' New-HTMLSection { - New-HTMLFrame -SourcePath "C:\Support\GitHub\PSWriteHTML\Examples\Example-Maps\Example-Maps.html" + New-HTMLFrame -SourcePath (Join-Path -Path (Split-Path -Parent $PSScriptRoot) -ChildPath 'Example-Maps/Example-Maps.html') } -HeaderText 'Test' -Height 100vh } -Online -TitleText 'Test Inline' -ShowHTML -FilePath "$PSScriptRoot\Example-InlineHTML01.html" -AddComment @@ -42,4 +42,4 @@ function Set-HTMLInline { } } -Set-HTMLInline -FilePath 'C:\Support\GitHub\PSWriteHTML\Examples\Example-InlineOtherHTMLFile.ps1\GPOZaurr.html' -Search 'iframeResizer.contentWindow.min.js' -Replace '' \ No newline at end of file +Set-HTMLInline -FilePath (Join-Path -Path $PSScriptRoot -ChildPath 'GPOZaurr.html') -Search 'iframeResizer.contentWindow.min.js' -Replace '' diff --git a/Examples/Example-Table/Example7_02_DataStoreJava.ps1 b/Examples/Example-Table/Example7_02_DataStoreJava.ps1 index 066f3aa4..89bf7670 100644 --- a/Examples/Example-Table/Example7_02_DataStoreJava.ps1 +++ b/Examples/Example-Table/Example7_02_DataStoreJava.ps1 @@ -21,4 +21,4 @@ $DataTable3 = @( } ) -$DataTable3 | Out-HtmlView -FilePath C:\Support\GitHub\PSWriteHTML\Examples\Example-Table\Example7_02_DataStoreJava.html -Online -DataStore JavaScript \ No newline at end of file +$DataTable3 | Out-HtmlView -FilePath (Join-Path -Path $PSScriptRoot -ChildPath 'Example7_02_DataStoreJava.html') -Online -DataStore JavaScript diff --git a/Examples/Example39-TableColumnOption/Example39_01.ps1 b/Examples/Example39-TableColumnOption/Example39_01.ps1 index 6806693f..3187ec01 100644 --- a/Examples/Example39-TableColumnOption/Example39_01.ps1 +++ b/Examples/Example39-TableColumnOption/Example39_01.ps1 @@ -1,4 +1,4 @@ -Import-Module "$PSSCriptRoot\..\..\PSWriteHTML.psd1" -Force +Import-Module (Join-Path -Path $PSScriptRoot -ChildPath '../../PSWriteHTML.psd1') -Force $Process = Get-Process | Select-Object -First 20 $ProcessesLimited = $Process | Select-Object -Property Id, Name, PriorityClass, ProductVersion, Company, Path, Description diff --git a/Examples/Example41-Navigation01/Example41-Navigation01.ps1 b/Examples/Example41-Navigation01/Example41-Navigation01.ps1 index 3dafae4d..3e5310ac 100644 --- a/Examples/Example41-Navigation01/Example41-Navigation01.ps1 +++ b/Examples/Example41-Navigation01/Example41-Navigation01.ps1 @@ -94,12 +94,12 @@ New-HTML { # This adds more pages with different content New-HTMLPage -Name 'Page2' { New-HTMLSection -Invisible { - New-HTMLFrame -SourcePath "C:\Support\GitHub\PSWriteHTML\Examples\Example-Maps\Example-Maps.html" + New-HTMLFrame -SourcePath (Join-Path -Path (Split-Path -Parent $PSScriptRoot) -ChildPath 'Example-Maps/Example-Maps.html') } -Height 93vh } New-HTMLPage -Name 'Page3' { New-HTMLSection { - New-HTMLFrame -SourcePath "C:\Support\GitHub\PSWriteHTML\Examples\Example-InlineOtherHTMLFile.ps1\GroupMembership-CriticalGroups_2021-05-20_002030.html" + New-HTMLFrame -SourcePath (Join-Path -Path (Split-Path -Parent $PSScriptRoot) -ChildPath 'Example-InlineOtherHTMLFile.ps1/GroupMembership-CriticalGroups_2021-05-20_002030.html') } -HeaderText 'Test' -Height 100vh } -} -ShowHTML -Online -FilePath $PSScriptRoot\Example41-Navigation01.html \ No newline at end of file +} -ShowHTML -Online -FilePath $PSScriptRoot\Example41-Navigation01.html diff --git a/Private/Parameters.Configuration.ps1 b/Private/Parameters.Configuration.ps1 index c49d6895..d53046fd 100644 --- a/Private/Parameters.Configuration.ps1 +++ b/Private/Parameters.Configuration.ps1 @@ -2201,5 +2201,3 @@ # 'JSXSS' # 'Mermaid' # ) -# Import-Module "C:\Support\GitHub\PSWriteHTML.Helper\PSWriteHTML.Helper.psd1" -Force -# Save-HTMLResource -Configuration $Configuration -Keys $Keys -PathToSave 'C:\Support\GitHub\PSWriteHTML\Resources\CSS' -Verbose diff --git a/Public/New-HTMLFrame.ps1 b/Public/New-HTMLFrame.ps1 index 095e4199..41820af1 100644 --- a/Public/New-HTMLFrame.ps1 +++ b/Public/New-HTMLFrame.ps1 @@ -37,13 +37,13 @@ .EXAMPLE New-HTML { New-HTMLSection { - New-HTMLFrame -SourcePath "$PSSCriptRoot\GPOZaurr.html" -Scrolling Auto + New-HTMLFrame -SourcePath (Join-Path -Path $PSScriptRoot -ChildPath 'GPOZaurr.html') -Scrolling Auto } -HeaderText 'Test' New-HTMLSection { - New-HTMLFrame -SourcePath "$PSSCriptRoot\GPOZaurr.html" -Scrolling Auto -Height 1500px + New-HTMLFrame -SourcePath (Join-Path -Path $PSScriptRoot -ChildPath 'GPOZaurr.html') -Scrolling Auto -Height 1500px } -HeaderText 'Test' New-HTMLSection { - New-HTMLFrame -SourcePath "C:\Support\GitHub\PSWriteHTML\Examples\Example-Maps\Example-Maps.html" + New-HTMLFrame -SourcePath (Join-Path -Path $PSScriptRoot -ChildPath 'Example-Maps/Example-Maps.html') } -HeaderText 'Test' -Height 100vh } -Online -TitleText 'Test Inline' -ShowHTML -FilePath "$PSScriptRoot\Example-InlineHTML01.html" -AddComment @@ -95,4 +95,4 @@ } -NewLine $Script } -} \ No newline at end of file +} From ebe4a3bf2c7d5720cdc379d663d957e6fafed87b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw=20K=C5=82ys?= Date: Mon, 7 Sep 2026 18:06:20 +0200 Subject: [PATCH 2/3] Fix portable frame example path --- Docs/New-HTMLFrame.md | 2 +- Public/New-HTMLFrame.ps1 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Docs/New-HTMLFrame.md b/Docs/New-HTMLFrame.md index e60cdc2b..7527e108 100644 --- a/Docs/New-HTMLFrame.md +++ b/Docs/New-HTMLFrame.md @@ -29,7 +29,7 @@ New-HTML { New-HTMLFrame -SourcePath (Join-Path -Path $PSScriptRoot -ChildPath 'GPOZaurr.html') -Scrolling Auto -Height 1500px } -HeaderText 'Test' New-HTMLSection { - New-HTMLFrame -SourcePath (Join-Path -Path $PSScriptRoot -ChildPath 'Example-Maps/Example-Maps.html') + New-HTMLFrame -SourcePath (Join-Path -Path (Split-Path -Parent $PSScriptRoot) -ChildPath 'Example-Maps/Example-Maps.html') } -HeaderText 'Test' -Height 100vh } -Online -TitleText 'Test Inline' -ShowHTML -FilePath "$PSScriptRoot\Example-InlineHTML01.html" -AddComment ``` diff --git a/Public/New-HTMLFrame.ps1 b/Public/New-HTMLFrame.ps1 index 41820af1..8d0224a4 100644 --- a/Public/New-HTMLFrame.ps1 +++ b/Public/New-HTMLFrame.ps1 @@ -43,7 +43,7 @@ New-HTMLFrame -SourcePath (Join-Path -Path $PSScriptRoot -ChildPath 'GPOZaurr.html') -Scrolling Auto -Height 1500px } -HeaderText 'Test' New-HTMLSection { - New-HTMLFrame -SourcePath (Join-Path -Path $PSScriptRoot -ChildPath 'Example-Maps/Example-Maps.html') + New-HTMLFrame -SourcePath (Join-Path -Path (Split-Path -Parent $PSScriptRoot) -ChildPath 'Example-Maps/Example-Maps.html') } -HeaderText 'Test' -Height 100vh } -Online -TitleText 'Test Inline' -ShowHTML -FilePath "$PSScriptRoot\Example-InlineHTML01.html" -AddComment From fb2331cba956b3b48bfc602c2a57bf636fc76c42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw=20K=C5=82ys?= Date: Mon, 7 Sep 2026 19:30:14 +0200 Subject: [PATCH 3/3] Use readable portable example paths --- Docs/New-HTMLFrame.md | 6 +++--- .../Example-InlineHTML01.ps1 | 8 ++++---- Examples/Example-Table/Example7_02_DataStoreJava.ps1 | 2 +- Examples/Example39-TableColumnOption/Example39_01.ps1 | 2 +- .../Example41-Navigation01/Example41-Navigation01.ps1 | 4 ++-- Public/New-HTMLFrame.ps1 | 6 +++--- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Docs/New-HTMLFrame.md b/Docs/New-HTMLFrame.md index 7527e108..7270cda4 100644 --- a/Docs/New-HTMLFrame.md +++ b/Docs/New-HTMLFrame.md @@ -23,13 +23,13 @@ Allows to inline other HTML files into the current HTML file. This can be useful ```powershell New-HTML { New-HTMLSection { - New-HTMLFrame -SourcePath (Join-Path -Path $PSScriptRoot -ChildPath 'GPOZaurr.html') -Scrolling Auto + New-HTMLFrame -SourcePath "$PSScriptRoot/GPOZaurr.html" -Scrolling Auto } -HeaderText 'Test' New-HTMLSection { - New-HTMLFrame -SourcePath (Join-Path -Path $PSScriptRoot -ChildPath 'GPOZaurr.html') -Scrolling Auto -Height 1500px + New-HTMLFrame -SourcePath "$PSScriptRoot/GPOZaurr.html" -Scrolling Auto -Height 1500px } -HeaderText 'Test' New-HTMLSection { - New-HTMLFrame -SourcePath (Join-Path -Path (Split-Path -Parent $PSScriptRoot) -ChildPath 'Example-Maps/Example-Maps.html') + New-HTMLFrame -SourcePath "${PSScriptRoot}/../Example-Maps/Example-Maps.html" } -HeaderText 'Test' -Height 100vh } -Online -TitleText 'Test Inline' -ShowHTML -FilePath "$PSScriptRoot\Example-InlineHTML01.html" -AddComment ``` diff --git a/Examples/Example-InlineOtherHTMLFile.ps1/Example-InlineHTML01.ps1 b/Examples/Example-InlineOtherHTMLFile.ps1/Example-InlineHTML01.ps1 index 31d3d678..81d4cd33 100644 --- a/Examples/Example-InlineOtherHTMLFile.ps1/Example-InlineHTML01.ps1 +++ b/Examples/Example-InlineOtherHTMLFile.ps1/Example-InlineHTML01.ps1 @@ -2,13 +2,13 @@ New-HTML { New-HTMLSection { - New-HTMLFrame -SourcePath (Join-Path -Path $PSScriptRoot -ChildPath 'GPOZaurr.html') -Scrolling Auto + New-HTMLFrame -SourcePath "$PSScriptRoot/GPOZaurr.html" -Scrolling Auto } -HeaderText 'Test' New-HTMLSection { - New-HTMLFrame -SourcePath (Join-Path -Path $PSScriptRoot -ChildPath 'GPOZaurr.html') -Scrolling Auto -Height 1500px + New-HTMLFrame -SourcePath "$PSScriptRoot/GPOZaurr.html" -Scrolling Auto -Height 1500px } -HeaderText 'Test' New-HTMLSection { - New-HTMLFrame -SourcePath (Join-Path -Path (Split-Path -Parent $PSScriptRoot) -ChildPath 'Example-Maps/Example-Maps.html') + New-HTMLFrame -SourcePath "$PSScriptRoot/../Example-Maps/Example-Maps.html" } -HeaderText 'Test' -Height 100vh } -Online -TitleText 'Test Inline' -ShowHTML -FilePath "$PSScriptRoot\Example-InlineHTML01.html" -AddComment @@ -42,4 +42,4 @@ function Set-HTMLInline { } } -Set-HTMLInline -FilePath (Join-Path -Path $PSScriptRoot -ChildPath 'GPOZaurr.html') -Search 'iframeResizer.contentWindow.min.js' -Replace '' +Set-HTMLInline -FilePath "$PSScriptRoot/GPOZaurr.html" -Search 'iframeResizer.contentWindow.min.js' -Replace '' diff --git a/Examples/Example-Table/Example7_02_DataStoreJava.ps1 b/Examples/Example-Table/Example7_02_DataStoreJava.ps1 index 89bf7670..5241ed6e 100644 --- a/Examples/Example-Table/Example7_02_DataStoreJava.ps1 +++ b/Examples/Example-Table/Example7_02_DataStoreJava.ps1 @@ -21,4 +21,4 @@ $DataTable3 = @( } ) -$DataTable3 | Out-HtmlView -FilePath (Join-Path -Path $PSScriptRoot -ChildPath 'Example7_02_DataStoreJava.html') -Online -DataStore JavaScript +$DataTable3 | Out-HtmlView -FilePath "$PSScriptRoot/Example7_02_DataStoreJava.html" -Online -DataStore JavaScript diff --git a/Examples/Example39-TableColumnOption/Example39_01.ps1 b/Examples/Example39-TableColumnOption/Example39_01.ps1 index 3187ec01..7b7b2029 100644 --- a/Examples/Example39-TableColumnOption/Example39_01.ps1 +++ b/Examples/Example39-TableColumnOption/Example39_01.ps1 @@ -1,4 +1,4 @@ -Import-Module (Join-Path -Path $PSScriptRoot -ChildPath '../../PSWriteHTML.psd1') -Force +Import-Module "$PSScriptRoot/../../PSWriteHTML.psd1" -Force $Process = Get-Process | Select-Object -First 20 $ProcessesLimited = $Process | Select-Object -Property Id, Name, PriorityClass, ProductVersion, Company, Path, Description diff --git a/Examples/Example41-Navigation01/Example41-Navigation01.ps1 b/Examples/Example41-Navigation01/Example41-Navigation01.ps1 index 3e5310ac..b6cecf4e 100644 --- a/Examples/Example41-Navigation01/Example41-Navigation01.ps1 +++ b/Examples/Example41-Navigation01/Example41-Navigation01.ps1 @@ -94,12 +94,12 @@ New-HTML { # This adds more pages with different content New-HTMLPage -Name 'Page2' { New-HTMLSection -Invisible { - New-HTMLFrame -SourcePath (Join-Path -Path (Split-Path -Parent $PSScriptRoot) -ChildPath 'Example-Maps/Example-Maps.html') + New-HTMLFrame -SourcePath "$PSScriptRoot/../Example-Maps/Example-Maps.html" } -Height 93vh } New-HTMLPage -Name 'Page3' { New-HTMLSection { - New-HTMLFrame -SourcePath (Join-Path -Path (Split-Path -Parent $PSScriptRoot) -ChildPath 'Example-InlineOtherHTMLFile.ps1/GroupMembership-CriticalGroups_2021-05-20_002030.html') + New-HTMLFrame -SourcePath "$PSScriptRoot/../Example-InlineOtherHTMLFile.ps1/GroupMembership-CriticalGroups_2021-05-20_002030.html" } -HeaderText 'Test' -Height 100vh } } -ShowHTML -Online -FilePath $PSScriptRoot\Example41-Navigation01.html diff --git a/Public/New-HTMLFrame.ps1 b/Public/New-HTMLFrame.ps1 index 8d0224a4..f4245bcf 100644 --- a/Public/New-HTMLFrame.ps1 +++ b/Public/New-HTMLFrame.ps1 @@ -37,13 +37,13 @@ .EXAMPLE New-HTML { New-HTMLSection { - New-HTMLFrame -SourcePath (Join-Path -Path $PSScriptRoot -ChildPath 'GPOZaurr.html') -Scrolling Auto + New-HTMLFrame -SourcePath "$PSScriptRoot/GPOZaurr.html" -Scrolling Auto } -HeaderText 'Test' New-HTMLSection { - New-HTMLFrame -SourcePath (Join-Path -Path $PSScriptRoot -ChildPath 'GPOZaurr.html') -Scrolling Auto -Height 1500px + New-HTMLFrame -SourcePath "$PSScriptRoot/GPOZaurr.html" -Scrolling Auto -Height 1500px } -HeaderText 'Test' New-HTMLSection { - New-HTMLFrame -SourcePath (Join-Path -Path (Split-Path -Parent $PSScriptRoot) -ChildPath 'Example-Maps/Example-Maps.html') + New-HTMLFrame -SourcePath "${PSScriptRoot}/../Example-Maps/Example-Maps.html" } -HeaderText 'Test' -Height 100vh } -Online -TitleText 'Test Inline' -ShowHTML -FilePath "$PSScriptRoot\Example-InlineHTML01.html" -AddComment