23 lines
514 B
PowerShell
23 lines
514 B
PowerShell
|
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
|
||
|
}
|
||
|
|