diff options
Diffstat (limited to 'lib/ansible/module_utils/powershell/Ansible.ModuleUtils.Legacy.psm1')
-rw-r--r-- | lib/ansible/module_utils/powershell/Ansible.ModuleUtils.Legacy.psm1 | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/ansible/module_utils/powershell/Ansible.ModuleUtils.Legacy.psm1 b/lib/ansible/module_utils/powershell/Ansible.ModuleUtils.Legacy.psm1 index f0cb440f..4aea98b2 100644 --- a/lib/ansible/module_utils/powershell/Ansible.ModuleUtils.Legacy.psm1 +++ b/lib/ansible/module_utils/powershell/Ansible.ModuleUtils.Legacy.psm1 @@ -354,16 +354,16 @@ Function Get-FileChecksum($path, $algorithm = 'sha1') { $hash = $raw_hash.Hash.ToLower() } Else { - $fp = [System.IO.File]::Open($path, [System.IO.Filemode]::Open, [System.IO.FileAccess]::Read, [System.IO.FileShare]::ReadWrite); - $hash = [System.BitConverter]::ToString($sp.ComputeHash($fp)).Replace("-", "").ToLower(); - $fp.Dispose(); + $fp = [System.IO.File]::Open($path, [System.IO.Filemode]::Open, [System.IO.FileAccess]::Read, [System.IO.FileShare]::ReadWrite) + $hash = [System.BitConverter]::ToString($sp.ComputeHash($fp)).Replace("-", "").ToLower() + $fp.Dispose() } } ElseIf (Test-Path -LiteralPath $path -PathType Container) { - $hash = "3"; + $hash = "3" } Else { - $hash = "1"; + $hash = "1" } return $hash } |