-
Notifications
You must be signed in to change notification settings - Fork 33
Function LocalUser
Mark Wragg edited this page Jun 17, 2019
·
2 revisions
Test if a local user exists and is enabled.
Uses the Win32_UserAccount
WMI class to test if a local user exists and is enabled.
The local user name to test for. Eg 'Guest'
[Parameter(Mandatory, Position=1, ParameterSetName="Default")]
[Parameter(Mandatory, Position=1, ParameterSetName="Property")]
[Alias("Path")]
A Script Block defining a Pester Assertion.
[Parameter(Mandatory, Position=2, ParameterSetName="Default")]
[Parameter(Mandatory, Position=3, ParameterSetName="Property")]
Assertions: -Be
LocalUser 'Guest' { Should -Not -BeNullOrEmpty }
LocalUser 'Guest' Disabled { Should -Be $true }
LocalUser 'Administrator' Disabled { Should -Be $false }
Getting Started
Contributing
Functions