[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:
MyDrift
2024-11-06 19:11:36 +01:00
committed by GitHub
parent ce1ef2a519
commit e0889d51db
19 changed files with 858 additions and 879 deletions

View 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."
}
}