如何查看PowerShell在线文件的文件藏书?
好吧,我正在向Chris Titus Tech的终极Windows Toolkit提出拉扯请求,并且我想进行一些检查是否已更新。但是当我尝试跑步时:
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.
}
}
So well, I am making a pull request to Chris Titus Tech's Ultimate Windows Toolkit, and I wanna make something that checks if it's updated. But when I try running:
Get-FileHash -Algorithm SHA256 https://raw.githubusercontent.com/fgclue/etcher/master/desktop.ini
It just says:
Get-FileHash: Cannot find drive. A drive with the name 'https' does not exist.
And I want to make it look something like this:
$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.
}
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用
webrespenseobject.rawcontentstream
property 来自You can use the
WebResponseObject.RawContentStream
Property from the object outputted byInvoke-WebRequest
to check if the remote file and the local file are the same: