Format Date/Time
parent
895222c784
commit
ec73a55fe4
|
@ -16,8 +16,8 @@ function Test-ListPath ($ListPath, $UseWhiteList) {
|
||||||
$ExternalList = -join($ListPath, "\", $ListType, "_apps.txt")
|
$ExternalList = -join($ListPath, "\", $ListType, "_apps.txt")
|
||||||
if(Test-Path -Path $ExternalList -PathType leaf){
|
if(Test-Path -Path $ExternalList -PathType leaf){
|
||||||
Write-Output "Given path $ListPath type is $PathType and $ExternalList is available..."
|
Write-Output "Given path $ListPath type is $PathType and $ExternalList is available..."
|
||||||
$dateLocal = (Get-Item "$LocalList").LastWriteTime
|
$dateLocal = (Get-Item "$LocalList").LastWriteTime.ToString("yyyy-MM-dd HH:mm:ss")
|
||||||
$dateExternal = (Get-Item "$ListPath").LastWriteTime
|
$dateExternal = (Get-Item "$ListPath").LastWriteTime.ToString("yyyy-MM-dd HH:mm:ss")
|
||||||
if ($dateExternal -gt $dateLocal) {
|
if ($dateExternal -gt $dateLocal) {
|
||||||
Write-Host("$ExternalList is newer than $LocalList")
|
Write-Host("$ExternalList is newer than $LocalList")
|
||||||
}
|
}
|
||||||
|
@ -33,8 +33,8 @@ function Test-ListPath ($ListPath, $UseWhiteList) {
|
||||||
try {
|
try {
|
||||||
$wc.OpenRead("$ExternalList").Close() | Out-Null
|
$wc.OpenRead("$ExternalList").Close() | Out-Null
|
||||||
Write-Output "Given path $ListPath type is $PathType and $ExternalList is available..."
|
Write-Output "Given path $ListPath type is $PathType and $ExternalList is available..."
|
||||||
$dateLocal = (Get-Item "$LocalList").LastWriteTime
|
$dateLocal = (Get-Item "$LocalList").LastWriteTime.ToString("yyyy-MM-dd HH:mm:ss")
|
||||||
$dateExternal = $wc.ResponseHeaders['Last-Modified']
|
$dateExternal = ([DateTime]$wc.ResponseHeaders['Last-Modified']).ToString("yyyy-MM-dd HH:mm:ss")
|
||||||
if ($dateExternal -gt $dateLocal) {
|
if ($dateExternal -gt $dateLocal) {
|
||||||
Write-Host("$ExternalList is newer than $LocalList")
|
Write-Host("$ExternalList is newer than $LocalList")
|
||||||
}
|
}
|
||||||
|
@ -48,8 +48,8 @@ function Test-ListPath ($ListPath, $UseWhiteList) {
|
||||||
$ExternalList = -join($ListPath, "\", $ListType, "_apps.txt")
|
$ExternalList = -join($ListPath, "\", $ListType, "_apps.txt")
|
||||||
if(Test-Path -Path $ExternalList -PathType leaf){
|
if(Test-Path -Path $ExternalList -PathType leaf){
|
||||||
Write-Output "Given path $ListPath type is $PathType and $ExternalList is available..."
|
Write-Output "Given path $ListPath type is $PathType and $ExternalList is available..."
|
||||||
$dateLocal = (Get-Item "$LocalList").LastWriteTime
|
$dateLocal = (Get-Item "$LocalList").LastWriteTime.ToString("yyyy-MM-dd HH:mm:ss")
|
||||||
$dateExternal = (Get-Item "$ListPath").LastWriteTime
|
$dateExternal = (Get-Item "$ListPath").LastWriteTime.ToString("yyyy-MM-dd HH:mm:ss")
|
||||||
if ($dateExternal -gt $dateLocal) {
|
if ($dateExternal -gt $dateLocal) {
|
||||||
Write-Host("$ExternalList is newer than $LocalList")
|
Write-Host("$ExternalList is newer than $LocalList")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue