henrikstengaard / hstwb-installer

A set of scripts to automate installation of Amiga OS, Kickstart roms and packages to new or existing Amiga HDF files
https://hstwb.firstrealize.com
MIT License
100 stars 7 forks source link

Missing cmdlet from PowerShell setup script #71

Open Arawn-Davies opened 1 year ago

Arawn-Davies commented 1 year ago

When running hst_image_setup.cmd (or .ps1) on Windows 11, I'm getting a bunch of errors around GetHash

Get-FileHash : The term 'Get-FileHash' is not recognized as the name of a cmdlet, function, script file, or
operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and
try again.

I think it's a problem in newer PowerShell Core, as it's been mentioned in other issues, but a workaround someone found would be to add

Import-Module $PSHOME\Modules\Microsoft.PowerShell.Utility -Function Get-FileHash

at the beginning of the script, as this module is WinPS compatible.

https://github.com/PowerShell/PowerShell/issues/18108#issuecomment-1545956950