小编Dan*_*son的帖子

使用 Powershell 比较两个哈希值

我在同一目录中有两个文件我希望比较哈希值,Release.ziprelease821hash.txt

\n

我必须使用的第一个命令是 get-filehash Release.zip -a md5\n我必须使用的第二个命令是get-content release821hash.txt

\n

然后,我必须使用 -eq 来比较哈希值,按照实验室要求定义:

\n
1. Type "new hash" -eq "known hash" and press Enter to determine whether the\nfile hashes match.\n\xe2\x96\xa0 The new hash is the hash generated by the get-filehash file_name -a\nmd5 command.\n\xe2\x96\xa0 The known hash is the hash generated by the get-content\nfile_name.txt command.\n\xe2\x96\xa0 Include the quotation marks and the file extensions with the file names\nin the commands.\n
Run Code Online (Sandbox Code Playgroud)\n

但是我的 powershell 抛出错误。我尝试使用所有可能的方法来使用 -eq 进行比较,但它不断抛出错误。我究竟做错了什么?我尝试过不使用引号,只在“get”命令周围使用引号,并对整行使用一个引号。

\n

d

\n

powershell

3
推荐指数
1
解决办法
7072
查看次数

标签 统计

powershell ×1