Update samy.ps1
This commit is contained in:
37
samy.ps1
37
samy.ps1
@@ -91,29 +91,40 @@ $ConfirmPreference = 'None'
|
|||||||
# Configurable endpoints
|
# Configurable endpoints
|
||||||
$Global:DattoWebhookUrl = 'https://bananas.svstools.ca/dattormm'
|
$Global:DattoWebhookUrl = 'https://bananas.svstools.ca/dattormm'
|
||||||
|
|
||||||
# SAMY asset config (change branch or base once and it updates everything)
|
# 1) Params / defaults / branch selection logic (change branch or base once and it updates everything)
|
||||||
$Script:SamyBranch = 'beta' # 'main' or 'beta'
|
|
||||||
$Script:SamyRepoBase = 'https://git.svstools.ca/SVS_Public_Repo/SAMY/raw/branch'
|
$Script:SamyRepoBase = 'https://git.svstools.ca/SVS_Public_Repo/SAMY/raw/branch'
|
||||||
|
$Script:SamyBranch = 'beta' # 'main' or 'beta'
|
||||||
|
|
||||||
if (Get-Command Set-SvsPrinterRepoConfig -ErrorAction SilentlyContinue) {
|
if (Get-Command Set-SvsPrinterRepoConfig -ErrorAction SilentlyContinue) {
|
||||||
Set-SvsPrinterRepoConfig -RepoBase $Script:SamyRepoBase -Branch $Script:SamyBranch
|
Set-SvsPrinterRepoConfig -RepoBase $Script:SamyRepoBase -Branch $Script:SamyBranch
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# Top-left corner logo (SVS)
|
# 2) Build all remote URLs
|
||||||
$Script:SamyTopLogoUrl = "$Script:SamyRepoBase/$Script:SamyBranch/SVS_logo.svg"
|
$Script:SamyTopLogoUrl = "$Script:SamyRepoBase/$Script:SamyBranch/SVS_logo.svg?raw=1"
|
||||||
|
$Script:SamyBgLogoUrl = "$Script:SamyRepoBase/$Script:SamyBranch/SAMY.png?raw=1"
|
||||||
# Background SAMY image used in CSS
|
$Script:SamyFaviconUrl = "$Script:SamyRepoBase/$Script:SamyBranch/SVS_Favicon.ico?raw=1"
|
||||||
$Script:SamyBgLogoUrl = "$Script:SamyRepoBase/$Script:SamyBranch/SAMY.png?raw=1"
|
$Script:SamyCssUrl = "$Script:SamyRepoBase/$Script:SamyBranch/samy.css?raw=1"
|
||||||
$Script:SamyFaviconUrl = "$Script:SamyRepoBase/$Script:SamyBranch/SVS_Favicon.ico"
|
$Script:SamyJsUrl = "$Script:SamyRepoBase/$Script:SamyBranch/samy.js?raw=1"
|
||||||
$Script:SamyCssUrl = "$Script:SamyRepoBase/$Script:SamyBranch/samy.css?raw=1"
|
$Script:SamyHtmlUrl = "$Script:SamyRepoBase/$Script:SamyBranch/samy.html?raw=1"
|
||||||
$Script:SamyJsUrl = "$Script:SamyRepoBase/$Script:SamyBranch/samy.js?raw=1"
|
$Script:SamyTasksUrl = "$Script:SamyRepoBase/$Script:SamyBranch/samy.tasks.json?raw=1"
|
||||||
$Script:SamyHtmlUrl = "$Script:SamyRepoBase/$Script:SamyBranch/samy.html?raw=1"
|
$Script:SamyFunctionsUrl = "$Script:SamyRepoBase/$Script:SamyBranch/samy.functions.ps1?raw=1"
|
||||||
|
|
||||||
|
# Misc
|
||||||
$Script:SamyHintText = ""
|
$Script:SamyHintText = ""
|
||||||
$Script:SamyTasksUrl = "$Script:SamyRepoBase/$Script:SamyBranch/samy.tasks.json?raw=1"
|
|
||||||
|
|
||||||
|
# 3) Load remote functions (must be before calling them)
|
||||||
|
try {
|
||||||
|
$functionsContent = (Invoke-WebRequest -UseBasicParsing $Script:SamyFunctionsUrl -ErrorAction Stop).Content
|
||||||
|
}
|
||||||
|
catch {
|
||||||
|
throw "Failed to download samy.functions.ps1 from $Script:SamyFunctionsUrl. $($_.Exception.Message)"
|
||||||
|
}
|
||||||
|
. ([ScriptBlock]::Create($functionsContent))
|
||||||
|
|
||||||
|
# 4) Now call functions that live in samy.functions.ps1
|
||||||
|
# Initialize-NuGetProvider
|
||||||
|
|
||||||
|
# 5) Continue with rest of samy.ps1 logic (UI, CSS/JS/HTML download, etc.)
|
||||||
# Initialize a global in-memory log cache
|
# Initialize a global in-memory log cache
|
||||||
|
|
||||||
if (-not $Global:LogCache -or -not ($Global:LogCache -is [System.Collections.ArrayList])) {
|
if (-not $Global:LogCache -or -not ($Global:LogCache -is [System.Collections.ArrayList])) {
|
||||||
|
|||||||
Reference in New Issue
Block a user