mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
@@ -121,10 +121,11 @@ namespace Microsoft.PowerShell.Commands
|
||||
{
|
||||
byte[] bytehash = null;
|
||||
String hash = null;
|
||||
Stream openfilestream = null;
|
||||
|
||||
try
|
||||
{
|
||||
Stream openfilestream = File.OpenRead(path);
|
||||
openfilestream = File.OpenRead(path);
|
||||
bytehash = hasher.ComputeHash(openfilestream);
|
||||
|
||||
hash = BitConverter.ToString(bytehash).Replace("-","");
|
||||
@@ -138,6 +139,10 @@ namespace Microsoft.PowerShell.Commands
|
||||
path);
|
||||
WriteError(errorRecord);
|
||||
}
|
||||
finally
|
||||
{
|
||||
openfilestream?.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user