From b2ae01fc3eb55218583d7d92d1125d5942f3b3cf Mon Sep 17 00:00:00 2001 From: Andrew Schwartzmeyer Date: Wed, 20 Apr 2016 14:07:40 -0700 Subject: [PATCH] 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. --- test/powershell/Clear-Variable.Tests.ps1 | 1 - 1 file changed, 1 deletion(-) diff --git a/test/powershell/Clear-Variable.Tests.ps1 b/test/powershell/Clear-Variable.Tests.ps1 index 01728aff1d..01fa3e79cd 100644 --- a/test/powershell/Clear-Variable.Tests.ps1 +++ b/test/powershell/Clear-Variable.Tests.ps1 @@ -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"