Fix cryptic Pester failure

When the Pester tests were invoked over PSRP and the environment was
more pristine than a local client, the lack of a "foo" variable in some
scope caused the Pester test suite to emit an error at the end, failing
the PSRP build.

Removing the Clear-Variable directive eliminates this error, and is not
necessary for the Pester test itself.
This commit is contained in:
Andrew Schwartzmeyer
2016-04-20 14:07:40 -07:00
parent 2e35484e31
commit b2ae01fc3e
-1
View File
@@ -54,7 +54,6 @@ Describe "Clear-Variable DRT Unit Tests" -Tags DRT{
It "Clear-Variable Private variable Name should works and Get-Variable with local scope should throw exception"{
Set-Variable foo bar -Option Private
&{
Clear-Variable -Name foo
try {
Get-Variable -Name foo -Scope local -EA Stop
Throw "Execution OK"