Tests/Test-IsAdmin.tests.ps1
Try { Import-Module -Name Pester -MinimumVersion '5.0.0' -Force } Catch { Try { $module = Get-Module -Name Pester; $modulePath = Split-Path $module.Path; $psdPath = "{0}\{1}" -f $modulePath, "Pester.psd1" Import-Module $psdPath -ErrorAction Stop } Catch { Throw "Pester PS module could not be loaded. $($_.Exception.Message)" } } Describe "Test-IsAdmin" { Context "when function Test-IsAdmin is called" { It "should return '$True" { Test-IsAdmin | Should -Be $True -Because "Test must pass" } } } |