Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

File List ---Newbie

$
0
0

I am trying to create a msgbox that will list the file name and last modified date of the files in the folder.  This is my code so far:

$Results = Get-ChildItem "C:\Temp" -recurse

Foreach ($Result in $Results)

{

$Result2 = $Result.name

$Result3 = $Result.lastwritetime 

[Windows.Forms.MessageBox]::Show($Result2+" - "+$Result3, “Files Updated”, [Windows.Forms.MessageBoxButtons]::OK, [Windows.Forms.MessageBoxIcon]::Information)

}

 

This works except if lists each file separately.  I am looking for one msg box that lists ALL files like:

File1.txt                                 10/1/2013 10:00 AM

File2.txt                                 10/1/2013 10:02 AM


Viewing all articles
Browse latest Browse all 6937

Trending Articles