More optimizations
parent
6ce3171b67
commit
9133b9bac5
|
@ -12,11 +12,11 @@ function Test-ListPath ($ListPath, $UseWhiteList) {
|
||||||
if (Test-Path "$LocalList") {
|
if (Test-Path "$LocalList") {
|
||||||
$dateLocal = (Get-Item "$LocalList").LastWriteTime.ToString("yyyy-MM-dd HH:mm:ss")
|
$dateLocal = (Get-Item "$LocalList").LastWriteTime.ToString("yyyy-MM-dd HH:mm:ss")
|
||||||
}
|
}
|
||||||
|
$ExternalList = -join($ListPath, "\", $ListType, "_apps.txt")
|
||||||
$PathInfo=[System.Uri]$ListPath
|
$PathInfo=[System.Uri]$ListPath
|
||||||
|
|
||||||
if($PathInfo.IsUnc){
|
if($PathInfo.IsUnc){
|
||||||
$PathType="UNC Path"
|
$PathType="UNC Path"
|
||||||
$ExternalList = -join($ListPath, "\", $ListType, "_apps.txt")
|
|
||||||
if(Test-Path -Path $ExternalList -PathType leaf){
|
if(Test-Path -Path $ExternalList -PathType leaf){
|
||||||
Write-Host "Given path $ListPath type is $PathType and $ExternalList is available..."
|
Write-Host "Given path $ListPath type is $PathType and $ExternalList is available..."
|
||||||
$dateExternal = (Get-Item "$ExternalList").LastWriteTime.ToString("yyyy-MM-dd HH:mm:ss")
|
$dateExternal = (Get-Item "$ExternalList").LastWriteTime.ToString("yyyy-MM-dd HH:mm:ss")
|
||||||
|
@ -48,7 +48,6 @@ function Test-ListPath ($ListPath, $UseWhiteList) {
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$PathType="Local Path"
|
$PathType="Local Path"
|
||||||
$ExternalList = -join($ListPath, "\", $ListType, "_apps.txt")
|
|
||||||
if(Test-Path -Path $ExternalList -PathType leaf){
|
if(Test-Path -Path $ExternalList -PathType leaf){
|
||||||
Write-Host "Given path $ListPath type is $PathType and $ExternalList is available..."
|
Write-Host "Given path $ListPath type is $PathType and $ExternalList is available..."
|
||||||
$dateExternal = (Get-Item "$ExternalList").LastWriteTime.ToString("yyyy-MM-dd HH:mm:ss")
|
$dateExternal = (Get-Item "$ExternalList").LastWriteTime.ToString("yyyy-MM-dd HH:mm:ss")
|
||||||
|
@ -68,8 +67,8 @@ $WingetUpdatePath = "$env:ProgramData\Winget-AutoUpdate"
|
||||||
$ListPath = "https://www.knifmelti.se"
|
$ListPath = "https://www.knifmelti.se"
|
||||||
#$ListPath = "D:\Temp"
|
#$ListPath = "D:\Temp"
|
||||||
#$ListPath = "\\TempSERVER"
|
#$ListPath = "\\TempSERVER"
|
||||||
|
|
||||||
#$UseWhiteList = $true
|
#$UseWhiteList = $true
|
||||||
|
|
||||||
#White List or Black List in share/online if differs
|
#White List or Black List in share/online if differs
|
||||||
if ($WingetUpdatePath -ne $ListPath){
|
if ($WingetUpdatePath -ne $ListPath){
|
||||||
$NoClean = Test-ListPath $ListPath $UseWhiteList
|
$NoClean = Test-ListPath $ListPath $UseWhiteList
|
||||||
|
|
Loading…
Reference in New Issue