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
Script script.txt using Assert-M365DSCBlueprint and certificate thumbprint auth works with 1.23.322.1. Fails with 1.23.405.1
Exported ODsettings are very basic but all exports fail with the same errors od.ps1.txt
PS C:\github\M365DSC\Assess> .\CompareTargetWithBlueprint.ps1
Generate blueprint assessment for OD.ps1
VERBOSE: Dependencies were already successfully validated.
VERBOSE: GET file:///C:/Source/OD.m365 with 0-byte payload
VERBOSE: received 1704-byte response of content type application/octet-stream
Selected BluePrint contains (1) components to assess.
Initiating the Export of those (1) components from the tenant...
Export-M365DSCConfiguration : Cannot validate argument on parameter 'Credential'. The argument is null, empty, or an element of the argument collection contains a null
value. Supply a collection that does not contain any null values and then try the command again.
At C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.23.405.1\modules\M365DSCUtil.psm1:2663 char:25
+ -Credential $Credentials `
+ ~~~~~~~~~~~~
+ CategoryInfo : InvalidData: (:) [Export-M365DSCConfiguration], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationError,Export-M365DSCConfiguration
New-M365DSCDeltaReport : Cannot find file specified in parameter Source: C:\Users\LOCALA~1\AppData\Local\Temp\c54d7565-72e6-46c0-bf33-ecf7a9306a74.ps1. Please make sure
the file exists!
At C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.23.405.1\modules\M365DSCUtil.psm1:2674 char:9
+ New-M365DSCDeltaReport -Source $ExportPath `
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,New-M365DSCDeltaReport
Processing time for OD.ps1 is 00:00:21.5608381
Processing time was 00:00:21.5608381
PS C:\github\M365DSC\Assess>
The text was updated successfully, but these errors were encountered:
That's because the newly added ValidateScript doesn't work with parameters of type System.Management.Automation.PSCredential set to null so it cannot be used there as it is. Another one was also added to $TenantId which doesn't fail even if null even though it should, but that's a different topic for the PS team. See PowerShell/PowerShell#12557 for more info.
On both parameters the validation script uses Write-Warning but it won't be displayed since there's no way to tell the script we need to run in Verbose mode, instead if Write-Host is used it works.
Actually I didn't have the warnings being displayed because $WarningPreference was set to "SilentlyContinue" which Export-M365DSCConfiguration does right at the top of the function, and I ran it before, so it depends on how it's set.
Thanks for reporting. I did add a comment to the PR #3155 . I would look into the export function for properly passing the parameters to the export function - if this is possible.
Script script.txt using Assert-M365DSCBlueprint and certificate thumbprint auth works with 1.23.322.1. Fails with 1.23.405.1
Exported ODsettings are very basic but all exports fail with the same errors
od.ps1.txt
The text was updated successfully, but these errors were encountered: