@@ -9,7 +9,7 @@ Describe "PSDiagnostics cmdlets tests." -Tag "CI", "RequireAdminOnWindows" {
99 $PSDefaultParameterValues [" it:skip" ] = $true
1010 }
1111 else {
12- $LogSettingBak = Get-LogProperties - Name Microsoft - Windows - PowerShell / $LogType
12+ $LogSettingBak = Get-LogProperties - Name PowerShellCore / $LogType
1313 }
1414 }
1515 AfterAll {
@@ -20,37 +20,37 @@ Describe "PSDiagnostics cmdlets tests." -Tag "CI", "RequireAdminOnWindows" {
2020 }
2121
2222 Context " Test for Enable-PSTrace and Disable-PSTrace cmdlets." {
23- It " Should enable $LogType logs for Microsoft-Windows-PowerShell ." {
24- [XML ]$CurrentSetting = & wevtutil gl Microsoft - Windows - PowerShell / $LogType / f:xml
23+ It " Should enable $LogType logs for PowerShellCore ." {
24+ [XML ]$CurrentSetting = & wevtutil gl PowerShellCore / $LogType / f:xml
2525 if ($CurrentSetting.Channel.Enabled -eq ' true' ){
26- & wevtutil sl Microsoft - Windows - PowerShell / $LogType / e:false / q
26+ & wevtutil sl PowerShellCore / $LogType / e:false / q
2727 }
2828
2929 Enable-PSTrace - Force
3030
31- [XML ]$ExpectedOutput = & wevtutil gl Microsoft - Windows - PowerShell / $LogType / f:xml
31+ [XML ]$ExpectedOutput = & wevtutil gl PowerShellCore / $LogType / f:xml
3232
3333 $ExpectedOutput.Channel.enabled | Should - BeExactly ' true'
3434 }
3535
36- It " Should disable $LogType logs for Microsoft-Windows-PowerShell ." {
37- [XML ]$CurrentState = & wevtutil gl Microsoft - Windows - PowerShell / $LogType / f:xml
36+ It " Should disable $LogType logs for PowerShellCore ." {
37+ [XML ]$CurrentState = & wevtutil gl PowerShellCore / $LogType / f:xml
3838 if ($CurrentState.channel.enabled -eq ' false' ){
39- & wevtutil sl Microsoft - Windows - PowerShell / $LogType / e:true / q
39+ & wevtutil sl PowerShellCore / $LogType / e:true / q
4040 }
4141 Disable-PSTrace
4242
43- [XML ]$ExpectedOutput = & wevtutil gl Microsoft - Windows - PowerShell / $LogType / f:xml
43+ [XML ]$ExpectedOutput = & wevtutil gl PowerShellCore / $LogType / f:xml
4444
4545 $ExpectedOutput.Channel.enabled | Should - Be ' false'
4646 }
4747 }
4848
4949 Context " Test for Get-LogProperties cmdlet." {
50- It " Should return properties of $LogType logs for 'Microsoft-Windows-PowerShell '." {
51- [XML ]$ExpectedOutput = wevtutil gl Microsoft - Windows - PowerShell / $LogType / f:xml
50+ It " Should return properties of $LogType logs for 'PowerShellCore '." {
51+ [XML ]$ExpectedOutput = wevtutil gl PowerShellCore / $LogType / f:xml
5252
53- $LogProperty = Get-LogProperties - Name Microsoft - Windows - PowerShell / $LogType
53+ $LogProperty = Get-LogProperties - Name PowerShellCore / $LogType
5454
5555 $LogProperty.Name | Should - Be $ExpectedOutput.channel.Name
5656 $LogProperty.Enabled | Should - Be $ExpectedOutput.channel.Enabled
@@ -67,7 +67,7 @@ Describe "PSDiagnostics cmdlets tests." -Tag "CI", "RequireAdminOnWindows" {
6767 Context " Test for Set-LogProperties cmdlet." {
6868 BeforeAll {
6969 if ($IsWindows ) {
70- [XML ]$WevtUtilBefore = wevtutil gl Microsoft - Windows - PowerShell / $LogType / f:xml
70+ [XML ]$WevtUtilBefore = wevtutil gl PowerShellCore / $LogType / f:xml
7171 $LogPropertyToSet = [Microsoft.PowerShell.Diagnostics.LogDetails ]::new($WevtUtilBefore.channel.Name ,
7272 [bool ]::Parse($WevtUtilBefore.channel.Enabled ),
7373 $LogType ,
@@ -78,12 +78,12 @@ Describe "PSDiagnostics cmdlets tests." -Tag "CI", "RequireAdminOnWindows" {
7878 }
7979 }
8080
81- It " Should invert AutoBackup setting of $LogType logs for 'Microsoft-Windows-PowerShell '." {
81+ It " Should invert AutoBackup setting of $LogType logs for 'PowerShellCore '." {
8282 $LogPropertyToSet.AutoBackup = -not $LogPropertyToSet.AutoBackup
8383 Set-LogProperties - LogDetails $LogPropertyToSet - Force
8484
85- [XML ]$ExpectedOutput = & wevtutil gl Microsoft - Windows - PowerShell / $LogType / f:xml
86- (Get-LogProperties - Name Microsoft - Windows - PowerShell / $LogType ).AutoBackup | Should - Be ([bool ]::Parse($ExpectedOutput.Channel.Logging.AutoBackup ))
85+ [XML ]$ExpectedOutput = & wevtutil gl PowerShellCore / $LogType / f:xml
86+ (Get-LogProperties - Name PowerShellCore / $LogType ).AutoBackup | Should - Be ([bool ]::Parse($ExpectedOutput.Channel.Logging.AutoBackup ))
8787 }
8888
8989 It " Should throw exception for invalid LogName." {
0 commit comments