mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2025-06-28 09:04:47 -05:00
[Microwin] dedicated Function folder (#2888)
* move Microwin related stuff to own Folder under "Functions" * update runspace function gathering logic * update Recall logic (from main repo) * change to easier naming scheme - rename files - rename function names * remove unneeded comment (after @CodingWonders's suggestion)
This commit is contained in:
29
functions/microwin/Microwin-GetOscdimg.ps1
Normal file
29
functions/microwin/Microwin-GetOscdimg.ps1
Normal file
@ -0,0 +1,29 @@
|
||||
function Microwin-GetOscdimg {
|
||||
<#
|
||||
.DESCRIPTION
|
||||
This function will download oscdimg file from github Release folders and put it into env:temp folder
|
||||
|
||||
.EXAMPLE
|
||||
Microwin-GetOscdimg
|
||||
#>
|
||||
|
||||
param(
|
||||
[Parameter(Mandatory, position=0)]
|
||||
[string]$oscdimgPath
|
||||
)
|
||||
|
||||
$oscdimgPath = "$env:TEMP\oscdimg.exe"
|
||||
$downloadUrl = "https://github.com/ChrisTitusTech/winutil/raw/main/releases/oscdimg.exe"
|
||||
Invoke-RestMethod -Uri $downloadUrl -OutFile $oscdimgPath
|
||||
$hashResult = Get-FileHash -Path $oscdimgPath -Algorithm SHA256
|
||||
$sha256Hash = $hashResult.Hash
|
||||
|
||||
Write-Host "[INFO] oscdimg.exe SHA-256 Hash: $sha256Hash"
|
||||
|
||||
$expectedHash = "AB9E161049D293B544961BFDF2D61244ADE79376D6423DF4F60BF9B147D3C78D" # Replace with the actual expected hash
|
||||
if ($sha256Hash -eq $expectedHash) {
|
||||
Write-Host "Hashes match. File is verified."
|
||||
} else {
|
||||
Write-Host "Hashes do not match. File may be corrupted or tampered with."
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user