Dear Morten,
I have the following dataset code:
`
$leni = [double]::MaxValue -1
$customObject = New-Object PSObject -Property @{
Counter = [int]$oneContent.ID
Location_MachineNumber = [string]$oneContent.Location_MachineNumber
Year = [int]$oneContent.Year
Month = [int]$oneContent.Month
Day = [int]$oneContent.Day
Subfolder = [string]$oneContent.Subfolder
Filename = [string]$oneContent.Filename
FileCreationTimeUTC = [datetime]$oneContent.FileCreationTimeUTC
FileLastWriteTimeUTC = [datetime]$oneContent.'File-LastWriteTimeUTC'
FileLength = [double]$leni
}
$Datavariable = $customObject`
It results in the following object:
`
PS C:\Users\l2> $customObject
CollectionTime : 12/27/2023 11:10:09 AM
Computer : SERVER1
Counter : 1
Day : 17
FileCreationTimeUTC : 12/17/2022 12:24:35 AM
FileLastWriteTimeUTC : 12/18/2022 8:14:48 PM
FileLength : 1.79769313486232E+308
Filename : images.zip
Location_MachineNumber : PLI_1884
Month : 12
Subfolder : NOTOK
UserLoggedOn : l2
Year : 2022
`
When running "CheckCreateUpdate-TableDcr-Structure" I get the following error:
invoke-webrequest : {"error":{"code":"InvalidPayload","message":"Data collection rule is invalid","details":[{"code":"InvalidTransformOutput","message":"Types of transform output columns do not match the ones defined by the output stream: FileLength
[DateTime]","target":"properties.dataFlows[0]"}]}}
The DCR table is not existing.
When checking the type of FileLength it shows correct information in PowerShell:
`$customObject.FileLength.GetType()
IsPublic IsSerial Name BaseType
True True Double System.ValueType `
Any idea what could be wrong in my dataset?