Tests/Unit/Stop-ScriptLogger.Tests.ps1
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
$modulePath = Resolve-Path -Path "$PSScriptRoot\..\..\.." | Select-Object -ExpandProperty Path $moduleName = Resolve-Path -Path "$PSScriptRoot\..\.." | Get-Item | Select-Object -ExpandProperty BaseName Remove-Module -Name $moduleName -Force -ErrorAction SilentlyContinue Import-Module -Name "$modulePath\$moduleName" -Force Describe 'Stop-ScriptLogger' { It 'should clean up the looger' { # Arrange Start-ScriptLogger -Path 'TestDrive:\test.log' # Act Stop-ScriptLogger # Assert Get-ScriptLogger | Should -BeNullOrEmpty } } |