Author | external help file | Module Guid | Module Name | online version | schema |
---|---|---|---|---|---|
Paul Boyer |
psvault-Utilities-help.xml |
0ba23f80-06be-4ccc-a218-05969d5e5b5e |
psvault-Utilities |
2.0.0 |
Quick script to compare file hashes of contents between two directories
Compare-FileHash [-DifferenceDirectory] <String> [-ReferenceDirectory] <String> [[-Algorithm] <String>]
[[-Recurse] <ParameterAttribute>] [[-Path] <String>] [<CommonParameters>]
Script get the child items in each directory (recursing if necessary) and then hashes each file. Then the two sets of file hashes are compared using Compare-Object. The results can be piped out to a file.
Compare-FileHash -ReferenceDirectory C:\Windows -DifferenceDirectory D:\Windows -Recurse
Path to the directory to compare as the right operand (=>)
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Path to the directory to compare as the left operand (<=)
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
String parameter for which algorithm to use to compute hashes. Accepted values are SHA1, SHA256, SHA384, SHA512, MD5
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 3
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Switch parameter that will cause the reference and difference directories to recurse through all files, not just at the depth that was passed
Type: ParameterAttribute
Parameter Sets: (All)
Aliases:
Required: False
Position: 4
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Path to the output file
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 5
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.