Ejercicios de PowerShell: realizar una función que permita detectar que hay una firma igual a otra
# Función simple para almacenar un hash de un programa
function hashear($ruta){
Get-FileHash $ruta
}
(hashear 'C:\Windows\System32\notepad.exe' | select hash).hash | Out-File hash.txt
(gc hash.txt)
Get-Process | select Path | %{
hashear $_.Path
}
Get-Process | select Path | %{
(hashear $_.Path).hash
}
Get-Process | select Path | %{
if ((hashear $_.Path).hash -match (gc hash.txt))
{
"Igual",$_.path
}
}