Skip to content

Commit b00018d

Browse files
committed
backwards compatible date format for older powershell clients
1 parent e4830cb commit b00018d

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

gather log events - remoting.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Exit-PSSession
4343
#--------------------------------------------------------------------------------------
4444

4545
##Execute this block with F8 not F5
46-
$timestamp = Get-Date -Format u
46+
$timestamp = (Get-Date).ToString('yyyyMMddTHHmmss')
4747
$logtargetfile = "\\"+$target+"\C$\temp\"+$target+" log export.csv"
4848
$loglocalfile = "C:\temp\"+$target+" log export "+$timestamp+".csv"
4949
copy-item $logtargetfile $loglocalfile

gather log events.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ $EventLog_Security = Get-EventLog -LogName "Security" -After (Get-Date).AddDays(
2727
## Version that works on PowerShell 2.0 because of Add-Member and Out-Gridview dependencies aren't supported until 3.0
2828

2929
clear-host
30-
$numDays = -30
31-
$timestamp = Get-Date -Format u
30+
$numDays = -90
31+
$timestamp = (Get-Date).ToString('yyyyMMddTHHmmss')
3232
$exportpath = "C:\temp\"+$env:computername+" log export " +$timestamp+".csv"
3333
$eventLog_Application = @()
3434
Get-EventLog -LogName "Application" -After (Get-Date).AddDays($numDays) |

0 commit comments

Comments
 (0)