Ich experimentiere momentan mit der Powershell 1.0 und komm nicht weiter .
folgender Code läuft einwandfrei
PS C:\mytest> $path="C:\WINDOWS\system32\aclui.dll" PS C:\mytest> [System.Diagnostics.FileVersionInfo]::GetVersionInfo($path )Ausgabe:
ProductVersion FileVersion FileName
-------------- ----------- --------
5.2.3790.3959 5.2.3790.3959... C:\WINDOWS\system32\aclui.dll
analog dazu will ich mit der Klasse System.IO.FileInfo
z.B. die Eigenschaft "lastaccesstime" eines Files auslesen
mit
PS C:\mytest> $path="C:\WINDOWS\system32\aclui.dll" PS C:\mytest> [System.IO.FileInfo]::lastaccesstime($path)
bekomme ich die Ausgabe:
Method invocation failed because [System.IO.FileInfo] doesn't contain a method named 'lastaccesstime'.
At line:1 char:37
+ [System.IO.FileInfo]::lastaccesstime( <<<< $path)
Die Methode existiert natürlich bzw. auch andere Methoden liefern diegleiche Ausgabe
Dagegen läuft problemlos
PS C:\mytest> $path=get-item "C:\WINDOWS\system32\aclui.dll" PS C:\mytest> write-host $path.LastWriteTime
Ausgabe:
17.02.2007 15:02:40
Was ist an diesem Aufruf falsch?
PS C:\mytest> [System.IO.FileInfo]::lastaccesstime($path)
merci
blub










