You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Get-EventLog is deprecated in favor of Get-WinEvent and when trying to use WindowsEventLog from ComputerManagemntDsc with GuestConfig Agent I am getting an error message like the following
Verbose logs
The term 'Get-EventLog' is not recognized as a name of a cmdlet, function, script file, or executable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. The PowerShell DSC resource '[WindowsEventLog]LOG_NAME' with SourceInfo 'E:\agent\_work\1212\dev\build\configurations\dev\WindowsEventLog_LOG_NAME.ps1::6::9::WindowsEventLog' threw one or more non-terminating errors while running the Test-TargetResource functionality. These errors are logged to the ETW channel called Microsoft-Windows-DSC/Operational. Refer to this channel for more details. The SendConfigurationApply function did not succeed. LCM failed to start desired state configuration manually.
Problem description
Get-EventLog
is deprecated in favor ofGet-WinEvent
and when trying to useWindowsEventLog
from ComputerManagemntDsc with GuestConfig Agent I am getting an error message like the followingVerbose logs
DSC configuration
Suggested solution
Remove
Get-EventLog
from the following functionsGet-WindowsEventLogRestrictGuestAccess
andSet-WindowsEventLogRetentionDays
Replace 717 and 971 with the following code
$matchingEventLog = Get-WinEvent -ListLog $Logname -ErrorAction Stop
Operating system the target node is running
PowerShell version and build the target node is running
ComputerManagementDsc version
The text was updated successfully, but these errors were encountered: