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
# I go to tests folder:
cd $DSC_GIT_ROOT/Tests
# Import TestHarness
Import-Module -Verbose -Force ./TestHarness.psm1
# Then run the tests
Invoke-TestHarness -Verbose -IgnoreCodeCoverage
When running it from VSCode terminal, I have a lot of errors (100s, because it logs 1 to 3 errors per unit test) like bellow. Seems to be same as #828 , that has been fixed.
[2023/10/19 08:09:53]
{NotSpecified}
System.Management.Automation.MethodInvocationException: Exception calling "SourceExists" with "1" argument(s): "The source was not found, but some or all event logs could not be searched. Inaccessible logs: Security, State."
---> System.Security.SecurityException: The source was not found, but some or all event logs could not be searched. Inaccessible logs: Security, State.
at System.Diagnostics.EventLog.FindSourceRegistration(String source, String machineName, Boolean readOnly, Boolean wantToCreate)
at System.Diagnostics.EventLog.SourceExists(String source, String machineName, Boolean wantToCreate)
at CallSite.Target(Closure, CallSite, Type, String)
--- End of inner exception stack trace ---
at System.Management.Automation.ExceptionHandlingOps.CheckActionPreference(FunctionContext funcContext, Exception exception)
at System.Management.Automation.Interpreter.ActionCallInstruction`2.Run(InterpretedFrame frame)
at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
"Could not write to event log Source {MSFT_AADCrossTenantAccessPolicy} EntryType {Warning} Message {<M365DSCEvent>
<ConfigurationDrift Source="MSFT_AADCrossTenantAccessPolicy">
<ParametersNotInDesiredState>
<Param Name="AllowedCloudEndpoints"><CurrentValue>microsoftonline.com</CurrentValue><DesiredValue>microsoftonline.us</DesiredValue></Param>
</ParametersNotInDesiredState>
</ConfigurationDrift>
<DesiredValues>
<Param Name ="Credential">System.Management.Automation.PSCredential</Param>
<Param Name ="AllowedCloudEndpoints">microsoftonline.us</Param>
<Param Name ="Ensure">Present</Param>
<Param Name ="IsSingleInstance">Yes</Param>
<Param Name ="DisplayName">MyXTAPPolicy</Param>
</DesiredValues>
</M365DSCEvent>}"
at Add-M365DSCEvent, Y:\Microsoft365DSC\Modules\Microsoft365DSC\modules\M365DSCLogEngine.psm1: line 194
The text was updated successfully, but these errors were encountered:
This is very true. The issue is within the Log-Engine. We added some checks in the past to not try to create a new event log. Looks like we need to add a check as well not to write to the error log in this case
I follow the old video : https://www.youtube.com/watch?v=MmUtdEkLM6M
I import the Pester module that should have been had after the recording of the video:
Then
When running it from VSCode terminal, I have a lot of errors (100s, because it logs 1 to 3 errors per unit test) like bellow. Seems to be same as #828 , that has been fixed.
The text was updated successfully, but these errors were encountered: