Skip to content

Commit

Permalink
fixed missing .Count function on PoSH v2
Browse files Browse the repository at this point in the history
  • Loading branch information
rob-no authored and cameron-huntress committed Oct 19, 2023
1 parent 143d50a commit 9d68fb3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Powershell/InstallHuntress.powershellv2.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,9 @@ function KillProcessByName {
)

$processes = Get-Process | Where-Object { $_.ProcessName -eq $ProcessName }
$processCount = $processes | Measure-Object | Select-Object -ExpandProperty Count

if ($processes.Count -eq 0) {
if ($processCount -eq 0) {
LogMessage "No processes with the name '$ProcessName' are currently running."
}
else {
Expand Down

0 comments on commit 9d68fb3

Please sign in to comment.