-
-
Notifications
You must be signed in to change notification settings - Fork 114
Expand file tree
/
Copy pathExample-InlineHTML01.ps1
More file actions
45 lines (35 loc) · 1.61 KB
/
Copy pathExample-InlineHTML01.ps1
File metadata and controls
45 lines (35 loc) · 1.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
Import-Module .\PSWriteHTML.psd1 -Force
New-HTML {
New-HTMLSection {
New-HTMLFrame -SourcePath "$PSScriptRoot/GPOZaurr.html" -Scrolling Auto
} -HeaderText 'Test'
New-HTMLSection {
New-HTMLFrame -SourcePath "$PSScriptRoot/GPOZaurr.html" -Scrolling Auto -Height 1500px
} -HeaderText 'Test'
New-HTMLSection {
New-HTMLFrame -SourcePath "$PSScriptRoot/../Example-Maps/Example-Maps.html"
} -HeaderText 'Test' -Height 100vh
} -Online -TitleText 'Test Inline' -ShowHTML -FilePath "$PSScriptRoot\Example-InlineHTML01.html" -AddComment
# Modify file
return
function Set-HTMLInline {
[CmdletBinding()]
param(
[string] $FilePath,
[string] $Search,
[string] $Replace
)
if ($FilePath -and (Test-Path -LiteralPath $FilePath)) {
# lets get current information about file
$File = Get-Item -LiteralPath $FilePath
$LastModified = $File.LastWriteTime
$FileContent = Get-Content -Raw -LiteralPath $FilePath
if ($FileContent -notlike $Search) {
}
Set-Content -LiteralPath $FilePath -Value $FileContent
# <script type="text/javascript" src="https://cdn.jsdelivr.net/gh/davidjbradshaw/iframe-resizer@4.3.2/js/iframeResizer.contentWindow.min.js"></script>
# replace modification date:
$file.LastWriteTime = $lastModified
}
}
Set-HTMLInline -FilePath "$PSScriptRoot/GPOZaurr.html" -Search 'iframeResizer.contentWindow.min.js' -Replace '<script type="text/javascript" src="https://cdn.jsdelivr.net/gh/davidjbradshaw/iframe-resizer@4.3.2/js/iframeResizer.contentWindow.min.js"></script>'