Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

General

Psscriptanalyzer Pester Test


Introduction

A repository of possibly helpful scripts

Usage

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")
}

About

General repository

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages