Add a simple test for Get-WinEvent on windows (Core + Full)

This commit is contained in:
Sergei Vorobev committed 2016-07-01 12:20:48 -07:00
1 parent c1d1b52869
commit 777ba09bce
2 files changed
+21

No files matched your search

@@ -122,6 +122,20 @@ try
Remove-Module -ErrorAction SilentlyContinue CimCmdlets
}
}
It 'loads Microsoft.PowerShell.Diagnostics' {
try
{
Import-Module Microsoft.PowerShell.Diagnostics -ErrorAction Stop
Get-WinEvent -LogName System -MaxEvents 1 | Should Not Be $null
[Microsoft.PowerShell.Commands.GetWinEventCommand].Assembly.Location | Should Be (
Join-Path $env:DEVPATH Microsoft.PowerShell.Commands.Diagnostics.dll)
}
finally
{
Remove-Module -ErrorAction SilentlyContinue Microsoft.PowerShell.Diagnostics
}
}
}
}