14634

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]
Auf Facebook teilen
Auf X (Twitter) teilen
Auf Reddit teilen
Auf Linkedin teilen

Content-ID: 156853

Url: https://administrator.de/forum/finde-fehler-nicht-in-script-156853.html

Ausgedruckt am: 04.05.2025 um 18:05 Uhr