-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathLinkReplace.ps1
86 lines (70 loc) · 2.5 KB
/
LinkReplace.ps1
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
param (
[Parameter(ValueFromPipelineByPropertyName=$true)]
[string]$templateLink,
[Parameter(ValueFromPipeline=$true)]
[string]$template
)
# Define the source and destination file paths based on the template
if($template -eq "bluebeam"){
$sourceFile = ".\Templates\BluebeamShareHTML.htm"
$destinationFile = ".\Templates\bluebeam.htm"
}
elseif($template -eq "chatgpt"){
$sourceFile = ".\Templates\chatGPTHTML.html"
$destinationFile = ".\Templates\chatgpt.htm"
}
elseif($template -eq "blonde"){
$sourceFile = ".\Templates\blondeHTML.html"
$destinationFile = ".\Templates\blonde.htm"
}
elseif($template -eq "fondo"){
$sourceFile = ".\Templates\fondoHTML.html"
$destinationFile = ".\Templates\fondo.htm"
}
elseif($template -eq "bbb"){
$sourceFile = ".\Templates\bbbHTML.htm"
$destinationFile = ".\Templates\bbb.htm"
}
elseif($template -eq "adobe"){
$sourceFile = ".\Templates\adobeHTML.htm"
$destinationFile = ".\Templates\adobe.htm"
}
elseif($template -eq "sharepointlink"){
$sourceFile = ".\Templates\sharepointlink-source.htm"
$destinationFile = ".\Templates\sharepointlink.htm"
}
elseif($template -eq "dcgovlink"){
$sourceFile = ".\Templates\dcgovlink-source.htm"
$destinationFile = ".\Templates\dcgovlink.htm"
}
elseif($template -eq "vista"){
$sourceFile = ".\Templates\vistaHTML.htm"
$destinationFile = ".\Templates\vista.htm"
}
else{
# Default to bluebeam if no template is specified
$sourceFile = ".\Templates\BluebeamShareHTML.htm"
$destinationFile = ".\Templates\bluebeam.htm"
}
Write-Output "$template selected."
Copy-Item -Path $sourceFile -Destination $destinationFile -Force
# Read in the file
$content = Get-Content -Path $destinationFile -Raw
# Replace the placeholder with the code
$updatedContent = $content -replace "\(\(\(LINK\)\)\)", $templateLink
# Write the updated content back to the file
Set-Content -Path $destinationFile -Value $updatedContent
# param (
# [string]$code
# )
# # Define the source and destination file paths
# $sourceFile = "BluebeamShareHTML.htm"
# $destinationFile = "bluebeam.htm"
# # Copy the source file to the destination
# Copy-Item -Path $sourceFile -Destination $destinationFile
# # Read the content of the copied file
# $content = Get-Content -Path $destinationFile -Raw
# # Replace the placeholder with the code
# $updatedContent = $content -replace "\(\(\(VERIFICATION\)\)\)", $code
# # Write the updated content back to the file
# Set-Content -Path $destinationFile -Value $updatedContent