Search all File in your drive for any particular day..

Powershell Search all File in your drive for any particular day

PS C:\> get-childitem | Select-Object -first 3

Directory: Microsoft.PowerShell.Core\FileSystem::C:\
Mode                LastWriteTime     Length Name
—-                ————-     —— —-
d—-         10/1/2010   9:46 AM            TestFile
PS C:\> get-childitem | Where-Object {$_.LastWriteTime -like “%10/1/2010%”}
PS C:\> get-childitem | Where-Object {$_.LastWriteTime -eq “10/1/2010   9:46 AM”}
No result

Well try something else

PS C:\> $d = get-date
PS C:\> get-childitem | Where-Object {$_.LastWriteTime -ge $d}

No result

Here comes the answer… Try following:

PS C:\> $d = get-date
PS C:\> get-childitem | Where-Object {$_.LastWriteTime -ge $d.date}

INTERVIEW PREPARATION IN 30 MINs – Read Following wires for a quick interview preparation.

  1. SQL Server DBA “Interview Questions And Answers”
  2. SQL Azure Interview Questions and Answers Part – 1
  3. SQL Azure Interview Questions and Answers Part – 2
  4. Powershell Interview Questions and Answers

Regards,

Online Powershell Classes @ http://tuitionaffordable.webstarts.com

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s