ps/Modules/Alkami.PowerShell.Common/Public/New-AlkamiEventSource.ps1

23 lines
514 B
PowerShell
Raw Normal View History

2023-05-30 22:51:22 -07:00
function New-AlkamiEventSource {
<#
.SYNOPSIS
Creates a New Event Source Under the AlkamiOps Log
#>
[CmdletBinding()]
Param(
[Parameter(Mandatory = $true)]
[string]$sourceName
)
$logLead = (Get-LogLeadName);
if (!Test-IsAdmin) {
Write-Warning ("$logLead : Unable to Create Event Source {0} as the User Is Not Running as an Administrator" -f $sourceName)
return
}
New-EventLog -LogName AlkamiOps -Source $sourceName -ErrorAction SilentlyContinue
}