Test update for PowerShell 2.0 compatibility

WarningVariable wasn't working properly in PS 2.0 tests for some reason, resulting in a false failure.  Changed it to work by mocking and verifying calls to Write-Warning instead.