New
#90
Command version can be fixed for Powershell 2.0
I, too, discovered that the command did not work for me in Win 7 sp1 64bit, under Powershell 2.0. The problem is that "Desktop" cannot be used as is.
However, it is possible to fix it to work thus:
This of course depends on the env variable existing and one's desktop actually being in the user folder, and not somewhere else.Code:PS C:\> get-winevent -FilterHashTable @{logname="Application"; id="1001"}| ?{$_. providername -match "wininit"} | fl timecreated, message | out-file $env:UserPro file\desktop\CHKDSKResults.txt
It is probably also possible to use
which returns the correct path for me, but I haven't figured out how to use it in the Powershell command. That would be a better solution, since it would still work if the desktop had been relocated.Code:[Environment]::GetFolderPath("Desktop")
--peter