[metrics] Use new string-hash functions instead of ps1 script
MODIFY
src/vcpkg/metrics.cpp
src/vcpkg/metrics.cpp
@@ -264,17 +264,10 @@ namespace vcpkg::Metrics
while (next != last)
{
- auto match = *next;
+ const auto match = *next;
if (match[0] != "00-00-00-00-00-00")
{
- const std::string matchstr = match[0];
- const System::PowershellParameter value("Value", matchstr);
- auto hash_result = System::powershell_execute_and_capture_output(
- "SHA256Hash", get_vcpkg_root() / "scripts" / "SHA256Hash.ps1", {value});
- Util::erase_remove_if(hash_result,
- [](char ch) { return !(ch >= 'A' && ch <= 'F') && !(ch >= '0' && ch <= '9'); });
- hash_result = Strings::ascii_to_lowercase(hash_result);
- return hash_result;
+ return vcpkg::Commands::Hash::get_string_hash(match[0], "SHA256");
}
++next;
}

[metrics] Use new string-hash functions instead of ps1 script