Ich habe mir erlaubt, Dein Script um eine Funktion zum ermitteln der Laufwerke zu ergänzen.
Dann brauch niemand etwas anpassen und es wird jedes Laufwerk untersucht.
Code:
Function Get-Disks {
[CmdletBinding()]
param (
[Parameter(Mandatory=$false)]
[string]$Computer="." )
$DiskInfoFixed = Get-WmiObject Win32_LogicalDisk -ComputerName $Computer -Filter 'DriveType=3'
$DiskInfoUSB = Get-WmiObject Win32_LogicalDisk -ComputerName $Computer -Filter 'DriveType=2'
$Drives=@()
$DiskInfoFixed | ForEach-Object {
$Drives+=$($($_.DeviceId) + "\")
}
$DiskInfoUSB | ForEach-Object {
$Drives+=$($($_.DeviceId) + "\")
}
return $Drives
}
date
$SearchPath = Get-Disks
$FilesFound = @()
$FileSearch = '*.jar'
foreach ($Path in $SearchPath)
{
$FilesFound += (Get-ChildItem -Path ${Path} -Filter ${FileSearch} -File -Recurse -ErrorAction SilentlyContinue)
}
$FilesFound.count
( $FilesFound.Fullname | ForEach-Object { Select-String "JndiLookup.class" $_ }).path
date
Ich hoffe das ist OK, und nochmals vielen Dank für dein Script.
Viele Grüße
Gerd
|