<# FPS:Containers:Make:SN-Initialize-Common-Locations:ACTIVE
#>
<#
.DESCRIPTION
Module: Make
Core Snippet: SN-Initialize-Common-Locations
Initializes the calling Script, Encapsulation, etc.
module Locations
.EXAMPLE
$overrideSrc = 'SN-Stub'
. (Get-ActiveFileNm -PS1
Initialize-Common-Locations)
.CC
[2024.11.06 JD] Integrated ConvertTo-DotFill
for use with the Show shortcut
[2024.11.05 JD] Integrated $showBuff
for use with the Show shortcut
[2024.09.29 JD] Removed hooked int testing
attributes. Use shortcut Show to
retrieve values.
[2024.09.25 JD] Original code release.
.NOTES
To test the locations configured
Show -Common
#>
if ($overrideSrc -gt "") {
$cmnCallingCode = $overrideSrc
} else {
$cmnCallingCode = $PSCmdlet.MyInvocation.MyCommand.Name
}
# Some overrides will use the full filename, but for
shortcuts we only want the shortcut name
if ($cmnCallingCode -like 'SC-*') { $cmnCallingCode = $cmnCallingCode.replace('SC-','') }
$cmnLoc_Logs = $global:pro_CIBase.RuntimeLogs+"\Common\$YYYY-$cmnCallingCode\$MM"
$cmnLoc_Logs += '\'+$DD+'-Log.txt'
$showBuff += (ConvertTo-DotFill $global:ShowDotLen ($cmnCallingCode+' Logs: $cmnLoc_Logs'))+$cmnLoc_Logs+'|'
switch ($cmnCallingCode) {
# Shortcuts - Use only the shortcut name
# Snippets
# CmdLets
'Update-Log' {
# The location of the log is established
in the calling CmdLet, scratch is needed
$cmnScratchLog = Mount-Path ($global:pro_CIBase.RuntimeScratch+"\Common")
$showBuff += (ConvertTo-DotFill $global:ShowDotLen 'Update-Log: $cmnScratchLog')+$cmnScratchLog+'|'
if ($cmnPrintValue -gt "") {
Write-Host $showBuff }
}
default { if
($cmnPrintValue -gt "") { Write-Host "$cmnCallingCode is not a configured option" } }
}