所以,我正在向Chris Titus Tech的Ultimate Windows Toolkit发出一个pull request,我想做一些检查它是否更新的东西。但是当我尝试运行时:
Get-FileHash -Algorithm SHA256 https://raw.githubusercontent.com/fgclue/etcher/master/desktop.ini
它只是说:
Get-FileHash:找不到驱动器。名称为“https”的驱动器不存在。我想让它看起来像这样:
$hash = Get-FileHash -Algorithm SHA256 URL
$chash = Get-FileHash -Algorithm SHA256 win10debloat.ps1
if ($hash -ne $chash){
Write-Host "There is an update!"
Write-Host "Update?"
$Opt = Read-Host "Choice"
if (Opt -ne y){
exit
}
if (Opt -ne yn){
Start-Process "https://github.com/ChrisTitusTech/win10script/"
Write-Host Please download the new version and close this windows.
}
}
1条答案
按热度按时间zbdgwd5y1#
您可以使用
Invoke-WebRequest
输出的对象的WebResponseObject.RawContentStream
属性来检查远程文件和本地文件是否相同: