struct(wakeup): use list for target computers
- prevent future multiple read of database file
This commit is contained in:
		
							parent
							
								
									939ff159f5
								
							
						
					
					
						commit
						56bc398bf0
					
				| @ -65,7 +65,10 @@ $broadcastIP = $db.WOLDatabase.Configuration.BroadcastAddress | ||||
| $port = $db.WOLDatabase.Configuration.Port | ||||
| $dnsSuffix = $db.WOLDatabase.Configuration.DnsSuffix | ||||
| 
 | ||||
| $db.WOLDatabase.Computers.Computer | Where-Object { $_.name -match "$targetComputer" } | ForEach-Object { | ||||
| $targetComputers = [System.Collections.Generic.List[PSObject]]::new() | ||||
| $db.WOLDatabase.Computers.Computer | Where-Object { $_.name -match "$targetComputer" } | ForEach-Object { $targetComputers.Add($_) } | ||||
| 
 | ||||
| $targetComputers | ForEach-Object { | ||||
|     if ( [String]::IsNullOrWhiteSpace($_.friendlyName)) | ||||
|     { | ||||
|         $name = $_.name | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user