A repository of possibly helpful scripts
Most of my scripts utilize a logger so that way you can review the logs at some point on your own time.If you don't want that then either comment
or remove all lines that start with $logger.
Basically we can check if the type is currently initated and if not then we can do it via this small piece of code
# This will grab the currently running script name and name the log file as such
if (!("PSLogger" -as [type])) {
$callingSCript = ($MyInvocation.MyCommand.Name) -split ('.ps1')
."\\UNC\Path\Here\Logging.ps1"
$logger = [PSLogger]::new($logPath, $callingScript)
}
# This will use "ScriptNameHere" to name the log file
if (!("PSLogger" -as [type])) {
."\\UNC\Path\Here\Logging.ps1"
$logger = [PSLogger]::new($logPath, "ScriptNameHere")
}