Tests/IncorrectLogin.ps1
param ([Security.SecureString]$somePassword) Import-Module -Name $PSScriptRoot\..\PSFPLInfo -Force # Note, this uses an incorrect username and password which is expected to throw an exception. $testState = 0; $badCredential = New-Object System.Management.Automation.PSCredential('incorrect@user.com', $somePassword) -ErrorAction SilentlyContinue; try { $test = Authenticate $badCredential } catch { # Exception caught, so we failed to authenticate $testState = 1; } if ($testState -ne 1) { throw "FailedTest"; } |