mirror of
https://github.com/serialexperiments0815/PowershellExcercises.git
synced 2026-07-12 15:32:25 +00:00
Added: 1. File extension filtered file-counter. 2. System-info display script (OS, CPU, RAM). 3. File listing script. 4. Filtered file renaming script by pattern. 5. Start of to-do-text-file for next commit.
18 lines
No EOL
812 B
PowerShell
18 lines
No EOL
812 B
PowerShell
# Call 'Get-ChildItem' cmdlet method to retrieve filesystem objects.
|
|
# './' specifies current directory.
|
|
# '-Recurse' instructs iterations through subdirectories.
|
|
# '-File' returns results for files only, no directories.
|
|
|
|
Get-ChildItem -Path './' -Recurse -File |
|
|
|
|
# Call 'Select-Object' cmdlet method to return specified properties.
|
|
# '-Property FullName' returns full String path for each object.
|
|
# '-Property LastWriteTime' returns DateTime for last modification.
|
|
|
|
Select-Object -Property FullName, LastWriteTime |
|
|
|
|
# Call 'Export-Csv' cmdlet method to convert outputs into CSV file.
|
|
# '-Path './folderFiles.csv'' returns output of file in current directory.
|
|
# '-NoTypeInformation' supresses #TYPE metadata line.
|
|
|
|
Export-Csv -Path './folderFiles.csv' -NoTypeInformation |