-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathresponse_script.ps1
46 lines (39 loc) · 988 Bytes
/
response_script.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
38
39
40
41
42
43
44
45
46
#in progress Summer 2019
$userid = 'andthenenteredalex'
$locations = @('\appdata\local\temp','\downloads','\documents')
foreach ( $i in $locations ) {
$location_variable = 'C:\users\' + $userid + $i
Write-Host `n $i`n
Get-ChildItem -path $location_variable | Where-Object {$_.psiscontainer -eq $false -and $_.lastwritetime -gt (Get-Date).AddDays(-2)} | Select-Object name,lastwritetime,extension | Sort-Object lastwritetime -Descending
}
# list of properties
#get-member
<#
set-accesscontrol
get-accesscontrol
encrypt
decrypt
gethashcode
gettype
pschildname
psdrive
psiscontainer
psparentpath
pspath
psprovider
attributes
creationtime
directory
directoryname
exists
extension
fullname
isreadonly
lastaccesstime
lastwritetime
length
name
basename
versioninfo
#>
#Get-ChildItem 'C:\users\andthenenteredalex\appdata\local\temp' | Where-Object {$_.PsisContainer -eq $false -and $_.lastwritetime -gt (get-date).adddays(-2)} | Select-Object name,lastwritetime,fileextension