14634
Goto Top

Finde fehler nicht in Script

HAllo, habe folgendes program:

$COMPAREDATE=GET-DATE
$NumberDays=360
$CSVFileLocation='C:\OldComps.CSV'
GET-QADCOMPUTER -SizeLimit 0 -IncludedProperties LastLogonTimeStamp | where { ($CompareDate-$_.LastLogonTimeStamp).Days -gt $NumberDays } | Select-Object Name, LastLogonTimeStamp, OSName, ParentContainerDN | Sort-Object ModificationDate, Name | Export-CSV $CSVFileLocation


Leider bekomme ich immer diesen Fehler:
Cannot find an overload for "op_Subtraction" and the argument count: "2".
At H:\Desktop\alte PC\TEST.ps1:4 char:93
+ GET-QADCOMPUTER -SizeLimit 0 -IncludedProperties LastLogonTimeStamp | where { ($CompareDate- <<<< $
_.LastLogonTimeStamp).Days -gt $NumberDays } | Select-Object Name, LastLogonTimeStamp, OSName, Parent
ContainerDN | Sort-Object ModificationDate, Name | Export-CSV $CSVFileLocation
    + CategoryInfo          : NotSpecified: (:) , MethodException
    + FullyQualifiedErrorId : MethodCountCouldNotFindBest
Ich weiß aber nicht was ich da falsch gemacht habe!?

[Edit Biber] Codeformatierung [/Edit]

Content-Key: 156853

Url: https://administrator.de/contentid/156853

Printed on: April 24, 2024 at 22:04 o'clock