-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Description
Prerequisites
- Write a descriptive title.
- Make sure you are able to repro it on the latest released version
- Search the existing issues.
- Refer to the FAQ.
- Refer to Differences between Windows PowerShell 5.1 and PowerShell.
Steps to reproduce
Daily CI builds are failing on Linux platforms because two script block logging tests are failing. One reason for the failures I found on my local Ubuntu 18.04 Linux VM, is because the complex regex matching failed in some cases. I fixed this by creating simpler matching, but the tests continued to fail in CI builds. The failure in CI builds appears to be because the tests picked up the wrong log entries, as the log text did not look like a script block log.
Expected behavior
CI script block logging tests to pass on Linux platformsActual behavior
CI script block logging tests failing due to regex match failure, and incorrect log entries.Error details
No response
Environment data
Name Value
---- -----
PSVersion 7.3.0-preview.3
PSEdition Core
GitCommitId 7.3.0-preview.3-25-geb72cedc331d54870d670c71f4bbc6544facf341
OS Microsoft Windows 10.0.19044
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0Visuals
Describing Basic SysLog tests on Linux
+
[-] Verifies scriptblock logging 2.2s
Expected like wildcard 'test01.ps1' to match 'Creating Scriptblock text (1 of 3):#12#⏎⏎# Module manifest for module 'Microsoft.Graph.Identity.SignIns'⏎⏎#⏎⏎# Generated by: Microsoft Corporation⏎⏎#⏎⏎# Generated on: 3/8/2022⏎⏎#⏎⏎⏎⏎@{⏎⏎⏎⏎# Script module or binary module file associated with this manifest.⏎⏎RootModule = './Microsoft.Graph.Identity.SignIns.psm1'⏎⏎⏎⏎# Version number of this module.⏎⏎ModuleVersion = '1.9.3'⏎⏎⏎⏎# Supported PSEditions⏎⏎CompatiblePSEditions = 'Core', 'Desktop'⏎⏎⏎⏎# ID used to uniquely identify this module⏎⏎GUID = '8d8d2305-e4d0-4551-a5cd-dbce85325cea'⏎⏎⏎⏎# Author of this module⏎⏎Author = 'Microsoft Corporation'⏎⏎⏎⏎# Company or vendor of this module⏎⏎CompanyName = 'Microsoft Corporation'⏎⏎⏎⏎# Copyright statement for this module⏎⏎Copyright = 'Microsoft Corporation. All rights reserved.'⏎⏎⏎⏎# Description of the functionality provided by this module⏎⏎Description = 'Microsoft Graph PowerShell Cmdlets'⏎⏎⏎⏎# Minimum version of the PowerShell engine required by this module⏎⏎PowerShellVersion = '5.1'⏎⏎⏎⏎# Name of the PowerShell host required by this module⏎⏎# PowerShellHostName = ''⏎⏎⏎⏎# Minimum version of the PowerShell host required by this module⏎⏎# PowerShellHostVersion = ''⏎⏎⏎⏎# Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only.⏎⏎DotNetFrameworkVersion = '4.7.2'⏎⏎⏎⏎# Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only.⏎⏎# ClrVersion = ''⏎⏎⏎⏎# Processor architecture (None, X86, Amd64) required by this module⏎⏎# ProcessorArchitecture = ''⏎⏎⏎⏎# Modules that must be imported into the global environment prior to importing this module⏎⏎RequiredModules = @(@{ModuleName = 'Microsoft.Graph.Authentication'; ModuleVersion = '1.9.3'; })⏎⏎⏎⏎# Assemblies that must be loaded prior to importing this module⏎⏎RequiredAssemblies = './bin/Microsoft.Graph.Identity.SignIns.private.dll'⏎⏎⏎⏎# Script files (.ps1) that are run in the caller's environment prior to importing this module.⏎⏎# ScriptsToProcess = @()⏎⏎⏎⏎# Type files (.ps1xml) to be loaded when importing this module⏎⏎# TypesToProcess = @()⏎⏎⏎⏎# Format files (.ps1xml) to be loaded when importing this module⏎⏎FormatsToProcess = './Microsoft.Graph.Identity.SignIns.format.ps1xml'⏎⏎⏎⏎# Modules to import as nested modules of the module specified in RootModule/ModuleToProcess⏎⏎# NestedModules = @()⏎⏎⏎⏎# Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export.⏎⏎FunctionsToExport = 'Confirm-MgInformationProtectionSignature', ⏎⏎ 'Confirm-MgRiskyUserCompromised', 'Get-MgDataPolicyOperation', ⏎⏎ 'Get-MgIdentityConditionalAccessAuthenticationContextClassReference', ⏎⏎ 'Get-MgIdentityConditionalAccessNamedLocation', ⏎⏎ 'Get-MgIdentityConditionalAccessPolicy', 'Get-MgIdentityProvider', ⏎⏎ 'Get-MgIdentityUserFlow', 'Get-MgInformationProtection', ⏎⏎ 'Get-MgInformationProtectionBitlocker', ⏎⏎ 'Get-MgInformationProtectionBitlockerRecoveryKey', ⏎⏎ 'Get-MgInformationProtectionDataLossPreventionPolicy', ⏎⏎ 'Get-MgInformationProtectionPolicy', ⏎⏎ 'Get-MgInformationProtectionPolicyLabel', ⏎⏎ 'Get-MgInformationProtectionSensitivityPolicySetting', ⏎⏎ 'Get-MgInformationProtectionThreatAssessmentRequest', ⏎⏎ 'Get-MgInformationProtectionThreatAssessmentRequestResult', ⏎⏎ 'Get-MgOauth2PermissionGrant', 'Get-MgOauth2PermissionGrantDelta', ⏎⏎ 'Get-MgOrganizationCertificateBasedAuthConfiguration', ⏎⏎ 'Get-MgOrganizationCertificateBasedAuthConfigurationByRef', ⏎⏎ 'Get-MgPolicyAccessReviewPolicy', ⏎⏎ 'Get-MgPolicyActivityBasedTimeoutPolicy', ⏎⏎ 'Get-MgPolicyAdminConsentRequestPolicy', ⏎⏎ 'Get-MgPolicyAppManagementPolicy', ⏎⏎ 'Get-MgPolicyAppManagementPolicyApplyTo', ⏎⏎ 'Get-MgPolicyAppManagementPolicyApplyToByRef', ⏎⏎ 'Get-MgPolicyAuthenticationFlowPolicy', ⏎⏎ 'Get-MgPolicyAuthenticationMethodPolicy', ⏎⏎ 'Get-MgPolicyAuthorizationPolicy', ⏎⏎ 'Get-MgPolicyAuthorizationPolicyDefaultUserRoleOverride', ⏎⏎ 'Get-MgPolicyB2CAuthenticationMethodPolicy', ⏎⏎ 'Get-MgPolicyClaimMappingPolicy', ⏎⏎ 'Get-MgPolicyCrossTenantAccessPolicy', ⏎⏎ 'Get-MgPolicyCrossTenantAccessPolicyDefault', ⏎⏎ 'Get-MgPolicyCrossTenantAccessPolicyPartner', ⏎⏎ 'Get-MgPolicyDefaultAppManagementPolicy', ⏎⏎ 'Get-MgPolicyDirectoryRoleAccessReviewPolicy', ⏎⏎ 'Get-MgPolicyExternalIdentityPolicy', ⏎⏎ 'Get-MgPolicyFeatureRolloutPolicy', ⏎⏎ 'Get-MgPolicyFeatureRolloutPolicyApplyTo', ⏎⏎ 'Get-MgPolicyHomeRealmDiscoveryPolicy', ⏎⏎ 'Get-MgPolicyIdentitySecurityDefaultEnforcementPolicy', ⏎⏎ 'Get-MgPolicyMobileAppManagementPolicy', ⏎⏎ 'Get-MgPolicyMobileDeviceManagementPolicy', ⏎⏎ 'Get-MgPolicyPermissionGrantPolicy', ⏎⏎ 'Get-MgPolicyPermissionGrantPolicyExclude', ⏎⏎ 'Get-MgPolicyPermissionGrantPolicyInclude', ⏎⏎ 'Get-MgPolicyRoleManagementPolicy', ⏎⏎ 'Get-MgPolicyRoleManagementPolicyAssignment', ⏎⏎ 'Get-MgPolicyRoleManagementPolicyAssignmentPolicy', ⏎⏎ 'Get-MgPolicyRoleManagementPolicyAssignmentPolicyByRef', ⏎⏎ 'Get-MgPolicyRoleManagementPolicyEffectiveRule', ⏎⏎ 'Get-MgPolicyRoleManagementPolicyRule', ⏎⏎ 'Get-MgPolicyServicePrincipalCreationPolicy', ⏎⏎ 'Get-MgPolicyServicePrincipalCreationPolicyExclude', ⏎⏎ 'Get-MgPolicyServicePrincipalCreationPolicyInclude', ⏎⏎ 'Get-MgPolicyTokenIssuancePolicy', ⏎⏎ 'Get-MgPolicyTokenLifetimePolicy', 'Get-MgRiskDetection', ⏎⏎ 'Get-MgRiskyUser', 'Get-MgRiskyUserHistory', 'Get-MgTrustFramework', ⏎⏎ 'Get-MgTrustFrameworkKeySet', 'Get-MgTrustFrameworkKeySetActiveKey', ⏎⏎ 'Get-MgTrustFrameworkPolicy', 'Get-MgTrustFrameworkPolicyContent', ⏎⏎ 'Get-MgUserAuthenticationEmailMethod', ⏎⏎ 'Get-MgUserAuthenticationFido2Method', ⏎⏎ 'Get-MgUserAuthenticationMethod', ⏎⏎ 'Get-MgUserAuthenticationMicrosoftAuthenticatorMethod', ⏎⏎ 'Get-MgUserAuthenticationMicrosoftAuthenticatorMethodDevice', ⏎⏎ 'Get-MgUserAuthenticationOperation', ⏎⏎ 'Get-MgUserAuthenticationPasswordlessMicrosoftAuthenticatorMethod', ⏎⏎ 'Get-MgUserAuthenticationPasswordlessMicrosoftAuthenticatorMethodDevice', ⏎⏎ 'Get-MgUserAuthenticationPasswordMethod', ⏎⏎ 'Get-MgUserAuthenticationPhoneMethod', ⏎⏎ 'Get-MgUserAuthenticationSoftwareOathMethod', ⏎⏎ 'Get-MgUserAuthenticationTemporaryAccessPassMethod', ⏎⏎ 'Get-MgUserAuthenticationWindowHello', ⏎⏎ 'Get-MgUserAuthenticationWindowHelloForBusinessMethodDevice', ⏎⏎ 'Get-MgUserInformationProtection', ⏎⏎ 'Inv', but it did not match.
211: $createdEvents[0].Message | Should -BeLike "$testFileName"
at , /home/vsts/work/1/s/test/powershell/Host/Logging.Tests.ps1: line 211
[-] Verifies scriptblock logging with null character 1.83s
Expected like wildcard 'test01.ps1' to match 'Creating Scriptblock text (1 of 1):#12#⏎⏎# Module manifest for module 'Microsoft.Graph.Files'⏎⏎#⏎⏎# Generated by: Microsoft Corporation⏎⏎#⏎⏎# Generated on: 3/8/2022⏎⏎#⏎⏎⏎⏎@{⏎⏎⏎⏎# Script module or binary module file associated with this manifest.⏎⏎RootModule = './Microsoft.Graph.Files.psm1'⏎⏎⏎⏎# Version number of this module.⏎⏎ModuleVersion = '1.9.3'⏎⏎⏎⏎# Supported PSEditions⏎⏎CompatiblePSEditions = 'Core', 'Desktop'⏎⏎⏎⏎# ID used to uniquely identify this module⏎⏎GUID = '474084f3-9317-4ff1-863f-808d6ff993c3'⏎⏎⏎⏎# Author of this module⏎⏎Author = 'Microsoft Corporation'⏎⏎⏎⏎# Company or vendor of this module⏎⏎CompanyName = 'Microsoft Corporation'⏎⏎⏎⏎# Copyright statement for this module⏎⏎Copyright = 'Microsoft Corporation. All rights reserved.'⏎⏎⏎⏎# Description of the functionality provided by this module⏎⏎Description = 'Microsoft Graph PowerShell Cmdlets'⏎⏎⏎⏎# Minimum version of the PowerShell engine required by this module⏎⏎PowerShellVersion = '5.1'⏎⏎⏎⏎# Name of the PowerShell host required by this module⏎⏎# PowerShellHostName = ''⏎⏎⏎⏎# Minimum version of the PowerShell host required by this module⏎⏎# PowerShellHostVersion = ''⏎⏎⏎⏎# Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only.⏎⏎DotNetFrameworkVersion = '4.7.2'⏎⏎⏎⏎# Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only.⏎⏎# ClrVersion = ''⏎⏎⏎⏎# Processor architecture (None, X86, Amd64) required by this module⏎⏎# ProcessorArchitecture = ''⏎⏎⏎⏎# Modules that must be imported into the global environment prior to importing this module⏎⏎RequiredModules = @(@{ModuleName = 'Microsoft.Graph.Authentication'; ModuleVersion = '1.9.3'; })⏎⏎⏎⏎# Assemblies that must be loaded prior to importing this module⏎⏎RequiredAssemblies = './bin/Microsoft.Graph.Files.private.dll'⏎⏎⏎⏎# Script files (.ps1) that are run in the caller's environment prior to importing this module.⏎⏎# ScriptsToProcess = @()⏎⏎⏎⏎# Type files (.ps1xml) to be loaded when importing this module⏎⏎# TypesToProcess = @()⏎⏎⏎⏎# Format files (.ps1xml) to be loaded when importing this module⏎⏎FormatsToProcess = './Microsoft.Graph.Files.format.ps1xml'⏎⏎⏎⏎# Modules to import as nested modules of the module specified in RootModule/ModuleToProcess⏎⏎# NestedModules = @()⏎⏎⏎⏎# Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export.⏎⏎FunctionsToExport = 'Add-MgDriveListContentTypeBaseTypeCopy', ⏎⏎ 'Add-MgDriveListContentTypeBaseTypeCopyFromContentTypeHub', ⏎⏎ 'Add-MgDriveListContentTypeCopy', ⏎⏎ 'Add-MgDriveListContentTypeCopyFromContentTypeHub', ⏎⏎ 'Add-MgShareListContentTypeBaseTypeCopy', ⏎⏎ 'Add-MgShareListContentTypeBaseTypeCopyFromContentTypeHub', ⏎⏎ 'Add-MgShareListContentTypeCopy', ⏎⏎ 'Add-MgShareListContentTypeCopyFromContentTypeHub', ⏎⏎ 'Copy-MgDriveListContentTypeBaseToDefaultContentLocation', ⏎⏎ 'Copy-MgDriveListContentTypeToDefaultContentLocation', ⏎⏎ 'Copy-MgShareListContentTypeBaseToDefaultContentLocation', ⏎⏎ 'Copy-MgShareListContentTypeToDefaultContentLocation', ⏎⏎ 'Get-MgDrive', 'Get-MgDriveActivity', 'Get-MgDriveBundle', ⏎⏎ 'Get-MgDriveBundleContent', 'Get-MgDriveFollowing', ⏎⏎ 'Get-MgDriveFollowingContent', 'Get-MgDriveItem', ⏎⏎ 'Get-MgDriveItemContent', 'Get-MgDriveList', ⏎⏎ 'Get-MgDriveListActivity', 'Get-MgDriveListColumn', ⏎⏎ 'Get-MgDriveListColumnSourceColumn', ⏎⏎ 'Get-MgDriveListColumnSourceColumnByRef', ⏎⏎ 'Get-MgDriveListContentType', 'Get-MgDriveListContentTypeBase', ⏎⏎ 'Get-MgDriveListContentTypeBaseByRef', ⏎⏎ 'Get-MgDriveListContentTypeBaseType', ⏎⏎ 'Get-MgDriveListContentTypeBaseTypeByRef', ⏎⏎ 'Get-MgDriveListContentTypeBaseTypeCompatibleHubContentType', ⏎⏎ 'Get-MgDriveListContentTypeColumn', ⏎⏎ 'Get-MgDriveListContentTypeColumnLink', ⏎⏎ 'Get-MgDriveListContentTypeColumnPosition', ⏎⏎ 'Get-MgDriveListContentTypeColumnPositionByRef', ⏎⏎ 'Get-MgDriveListContentTypeColumnSourceColumn', ⏎⏎ 'Get-MgDriveListContentTypeColumnSourceColumnByRef', ⏎⏎ 'Get-MgDriveListContentTypeCompatibleHubContentType', ⏎⏎ 'Get-MgDriveListDrive', 'Get-MgDriveListDriveByRef', ⏎⏎ 'Get-MgDriveListItem', 'Get-MgDriveListItemActivity', ⏎⏎ 'Get-MgDriveListItemAnalytic', 'Get-MgDriveListItemAnalyticByRef', ⏎⏎ 'Get-MgDriveListItemDelta', 'Get-MgDriveListItemDriveItem', ⏎⏎ 'Get-MgDriveListItemDriveItemByRef', 'Get-MgDriveListItemField', ⏎⏎ 'Get-MgDriveListItemVersion', 'Get-MgDriveListItemVersionField', ⏎⏎ 'Get-MgDriveListOperation', 'Get-MgDriveListSubscription', ⏎⏎ 'Get-MgDriveRoot', 'Get-MgDriveRootContent', 'Get-MgDriveSpecial', ⏎⏎ 'Get-MgDriveSpecialContent', 'Get-MgGroupDrive', ⏎⏎ 'Get-MgGroupDriveByRef', 'Get-MgShareDriveItem', ⏎⏎ 'Get-MgShareDriveItemByRef', 'Get-MgShareItem', ⏎⏎ 'Get-MgShareItemByRef', 'Get-MgShareList', 'Get-MgShareListActivity', ⏎⏎ 'Get-MgShareListColumn', 'Get-MgShareListColumnSourceColumn', ⏎⏎ 'Get-MgShareListColumnSourceColumnByRef', ⏎⏎ 'Get-MgShareListContentType', 'Get-MgShareListContentTypeBase', ⏎⏎ 'Get-MgShareListContentTypeBaseByRef', ⏎⏎ 'Get-MgShareListContentTypeBaseType', ⏎⏎ 'Get-MgShareListContentTypeBaseTypeByRef', ⏎⏎ 'Get-MgShareListContentTypeBaseTypeCompatibleHubContentType', ⏎⏎ 'Get-MgShareListContentTypeColumn', ⏎⏎ 'Get-MgShareListContentTypeColumnLink', ⏎⏎ 'Get-MgShareListContentTypeColumnPosition', ⏎⏎ 'Get-MgShareListContentTypeColumnPositionByRef', ⏎⏎ 'Get-MgShareListContentTypeColumnSourceColumn', ⏎⏎ 'Get-MgShareListContentTypeColumnSourceColumnByRef', ⏎⏎ 'Get-MgShareListContentTypeCompatibleHubContentType', ⏎⏎ 'Get-MgShareListDrive', 'Get-MgShareListDriveByRef', ⏎⏎ 'Get-MgShareListItem', 'Get-MgShareListItemActivity', ⏎⏎ 'Get-MgShareListItemAnalytic', 'Get-MgShareListItemAnalyticByRef', ⏎⏎ 'Get-MgShareListItemDelta', 'Get-MgShareListItemDriveItem', ⏎⏎ 'Get-MgShareListItemDriveItemByRef', 'Get-MgShareListItemField', ⏎⏎ 'Get-MgShareListItemVersion', 'Get-MgShareListItemVersionField', ⏎⏎ 'Get-MgShareListOperation', 'Get-MgShareListSubscription', ⏎⏎ 'Get-MgSharePermission', 'Get-MgShareRoot', 'Get-MgShareRootByRef', ⏎⏎ 'Get-MgShareSharedDriveItemSharedDriveItem', 'Get-MgShareSite', ⏎⏎ 'Get-MgShareSiteByRef', 'Get-MgUserDrive', 'Get-MgUserDriveByRef', ⏎⏎ 'Grant-MgSharePermission', 'Invoke-MgRecentDrive', ⏎⏎ 'Invoke-MgSharedDrive', 'Join-MgDriveListContentType', ⏎⏎ 'Join-MgDriveListContentTypeBas', but it did not match.
243: $createdEvents[0].Message | Should -BeLike "$testFileName"
at , /home/vsts/work/1/s/test/powershell/Host/Logging.Tests.ps1: line 243
+