Hi,
great Module, it has proven quite helpful so far. I have a minor feature request though:
Start-PsFCIV:
With the -online switch I receive the Hash Information as return objects. That's cool. What would be even better though, would be if that information contained the FileInfo object for the file. As it is I either have to remember the search root or change the values to contain the full path.
Using Accessors it would be fairly trivial to have Size, TimeStamp and Name actually return properties of the fileinfo object (so you can store all data in a single line).
Cheers and once again: Thanks.
Comments: Actually, no, not necessarily. My primary concern is getting a file info property on it, instead of a relative path to the root search. Adding properties to a file-info object would work well for my purposes, though something like this is cool too: ``` using System; using System.Collections.Generic; using System.IO; using System.Xml.Serialization; namespace PsFCIV { [XmlType(AnonymousType = true)] public class FCIVFILE_ENTRY { public FCIVFILE_ENTRY() { } public FCIVFILE_ENTRY(string path) { Path = new FileInfo(path); } public FCIVFILE_ENTRY(FileInfo path) { Path = path; } public String Name { get { return Path.Name; } } public FileInfo Path { get; set; } public long Size { get { return Path.Length; } } public DateTime TimeStamp { get { return Path.LastWriteTime; } } public String MD5 { get; set; } public String SHA1 { get; set; } public String SHA256 { get; set; } public String SHA384 { get; set; } public String SHA512 { get; set; } public override Int32 GetHashCode() { return Path.GetHashCode(); } public override Boolean Equals(Object other) { if (ReferenceEquals(null, other) || other.GetType() != GetType()) { return false; } return other.GetType() == GetType() && String.Equals(Path, ((FCIVFILE_ENTRY)other).Path); } } } ``` This way, setting Path will automatically populate Name, Size and Timestamp. Cheers
great Module, it has proven quite helpful so far. I have a minor feature request though:
Start-PsFCIV:
With the -online switch I receive the Hash Information as return objects. That's cool. What would be even better though, would be if that information contained the FileInfo object for the file. As it is I either have to remember the search root or change the values to contain the full path.
Using Accessors it would be fairly trivial to have Size, TimeStamp and Name actually return properties of the fileinfo object (so you can store all data in a single line).
Cheers and once again: Thanks.
Comments: Actually, no, not necessarily. My primary concern is getting a file info property on it, instead of a relative path to the root search. Adding properties to a file-info object would work well for my purposes, though something like this is cool too: ``` using System; using System.Collections.Generic; using System.IO; using System.Xml.Serialization; namespace PsFCIV { [XmlType(AnonymousType = true)] public class FCIVFILE_ENTRY { public FCIVFILE_ENTRY() { } public FCIVFILE_ENTRY(string path) { Path = new FileInfo(path); } public FCIVFILE_ENTRY(FileInfo path) { Path = path; } public String Name { get { return Path.Name; } } public FileInfo Path { get; set; } public long Size { get { return Path.Length; } } public DateTime TimeStamp { get { return Path.LastWriteTime; } } public String MD5 { get; set; } public String SHA1 { get; set; } public String SHA256 { get; set; } public String SHA384 { get; set; } public String SHA512 { get; set; } public override Int32 GetHashCode() { return Path.GetHashCode(); } public override Boolean Equals(Object other) { if (ReferenceEquals(null, other) || other.GetType() != GetType()) { return false; } return other.GetType() == GetType() && String.Equals(Path, ((FCIVFILE_ENTRY)other).Path); } } } ``` This way, setting Path will automatically populate Name, Size and Timestamp. Cheers