ps/Modules/Alkami.DevOps.Installation/Public/Copy-NewRelicCustomInstrumentationFiles.ps1

23 lines
960 B
PowerShell
Raw Normal View History

2023-05-30 22:51:22 -07:00
function Copy-NewRelicCustomInstrumentationFiles {
<#
.SYNOPSIS
Copies the New Relic .NET Agent Custom Instrumentation Files to the NR Extensions Folder
#>
[CmdletBinding()]
param(
)
$logLead = (Get-LogLeadName);
## Get the custom path from the current folder -> NewRelicCustomInstrumentation
$customInstrumentationPath = Join-Path $PSScriptRoot "NewRelicCustomInstrumentation"
if (Test-Path $customInstrumentationPath) {
$nrExtensionsPath = "C:\ProgramData\New Relic\.NET Agent\Extensions"
Write-Output ("$logLead : Copying Custom Instrumentation Files from {0} to {1}" -f $customInstrumentationPath, $nrExtensionsPath)
Get-ChildItem $customInstrumentationPath | Select-Object -ExpandProperty FullName | Copy-Item -Destination $nrExtensionsPath -Force
} else {
Write-Warning ("$logLead : Skipping copy of custom instrumentation files from {0}" -f $customInstrumentationPath)
}
}