-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathReport.ps1
37 lines (33 loc) · 1020 Bytes
/
Report.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<#
.SYNOPSIS
Report
Created By: Dana Meli-Wischman
Created Date: February, 2018
Last Modified Date: February 08, 2022
.DESCRIPTION
Returns a list of files from your chosen folder
to a Text file of your choice.
.EXAMPLE
report -In "D:\Software\_Games" -Out "D:\Downloads\OutFile.txt"
.NOTES
Still under development.
#>
param([string]$In, [string]$Out)
$FileVersion = "0.0.3"
Say "Report $FileVersion"
if (!($In)) {
Say "What directory do you want to read into the text file?"
Read-Host -Prompt "[Full Path to read in.]"
}
if (!($In)) { return }
Say "IN set as $In"
if (!($Out)) {
Say "What File to write the output to?"
Read-Host -Prompt "[Full Path/filename to write to.]"
}
if (!($Out)) { return }
Say "OUT set as $Out"
$Filetest = Test-Path -Path $Out
if ($Filetest -eq $true) { Remove-Item –Path $Out }
Say "Writing your output file for you."
Get-ChildItem -Path $In -Name -Recurse | Sort-Object | Out-File $Out