-
Notifications
You must be signed in to change notification settings - Fork 45
Expand file tree
/
Copy pathGet-iDriveLog.ps1
More file actions
26 lines (18 loc) · 805 Bytes
/
Get-iDriveLog.ps1
File metadata and controls
26 lines (18 loc) · 805 Bytes
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
function Get-iDriveLog {
[CmdletBinding()]
param (
)
begin {
$LogDirectory = "C:\ProgramData\IDrive\IBCOMMON\mkana\Session\Backup"
$FileList = get-childitem $LogDirectory | Sort-Object -Descending CreationTime
}
process {
$file = $FileList[0]
# $file = $filelist | Where-Object {$_.creationtime -gt (get-date).AddDays(-2) -and $_.creationtime -lt (get-date).AddDays(-1)}
# Get-Content -Path $LogDirectory\06-24* | ForEach-Object { if ($_ -match "success" ) { Write-Output $_ } }
# Get-Content -Path "$LogDirectory\$($file.name)" | ForEach-Object { if ($_ -match "success" ) { Write-Output $_ } }
Get-Content -Path "$LogDirectory\$($file.name)" | ForEach-Object { if ($_ ) { Write-Output $_ } }
}
end {
}
}