-
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
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")]
The Property to be expanded. If ommitted, Property will default to status. Can handle nested objects within properties.
[Parameter(Position=2, ParameterSetName="Property")]
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' Enabled { Should -Be $true }
Getting Started
Contributing
Functions