From 5318cecf3927fe2bb0cee97b488ec400ba278c85 Mon Sep 17 00:00:00 2001 From: Dicey Dai Date: Tue, 19 Apr 2016 02:46:36 -0700 Subject: [PATCH] Update New-Alias Pester Unit Test --- test/powershell/New-Alias.Tests.ps1 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/powershell/New-Alias.Tests.ps1 b/test/powershell/New-Alias.Tests.ps1 index 2792334191..0014bc9cf4 100644 --- a/test/powershell/New-Alias.Tests.ps1 +++ b/test/powershell/New-Alias.Tests.ps1 @@ -1,11 +1,12 @@ Describe "New-Alias DRT Unit Tests" -Tags DRT{ - It "New-Alias Constant should throw SessionStateException skip now as bug#777" -Skip:$true{ + It "New-Alias Constant should throw SessionStateUnauthorizedAccessException"{ try { New-Alias -Name "ABCD" -Value "foo" -Option "Constant" -Force:$true - New-Alias -Name "ABCD" -Value "foo" -Force:$true + New-Alias -Name "ABCD" -Value "foo" -Force:$true -ErrorAction Stop Throw "Execution OK" } catch { + $_.CategoryInfo| Should Match "SessionStateUnauthorizedAccessException" $_.FullyQualifiedErrorId | Should be "AliasNotWritable,Microsoft.PowerShell.Commands.NewAliasCommand" } }