Höglandets IT - GitLab

Skip to content
  • Lars Scheibling @lars.scheibling ·
    $cItems = Get-ChildItem -Path $ScanLocation -Recurse -Force | Where-Object { !$_.PSIsContainer -and $_.Name -like "java*.exe"}
    
    if ($cItems.Length -gt 0) {
        Write-Host "Found
    }
    Edited by Lars Scheibling
  • Lars Scheibling @lars.scheibling ·
    $ScanLocation = "C:\Program Files"
    $ScanLocation2 = "C:\Program Files (x86)"
    $cItems = Get-ChildItem -Path $ScanLocation -Recurse -Force | Where-Object { !$_.PSIsContainer -and $_.Name -like "java*.exe"}
    $dItems = Get-ChildItem -Path $ScanLocation2 -Recurse -Force | Where-Object { !$_.PSIsContainer -and $_.Name -like "java*.exe"}
    
    if ($cItems.Length -gt 0 -or $dItems.Length -gt 0) {
    Write-Host "Found
    }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment