Closed Xandernardo closed 4 years ago
Thank you for checking and the info is useful enough to know that basic commands (or at least the aliases) don't work. The Get-Content and Test-Path fails because the script uses different representation of a path (for example: \?\C:) to supports long names. If it's changed to a default one, it fails at split, getElementsByClassName, getElementsByTagName and the pause. Based on the table in the link below, Win 7 doesn't come with Powershell 3. https://docs.microsoft.com/en-us/powershell/scripting/install/installing-windows-powershell?view=powershell-6 Installing Powershell 3+ from the link above might be a solution but first check if you are not using applications not compatible with the newer powershell (it's included at each powershell version). I'll change the readme and changelog to reflect this, most likely some check in the script itself. I just have to make sure the commands for check are version compatible :). Thanks for the feedback.
About the long names: You can find more info here if you're interested: https://docs.microsoft.com/en-us/windows/desktop/FileIO/naming-a-file It wouldn't be required for most of the bundles but it failed at this one: 'Humble Book Bundle: Cybersecurity presented by Wiley'. Combined length of bundle name + file name was too long for normal representation. If you download similar bundle, you might be surprised when you examine the folder in the Windows Explorer. The size of the bundle folder might not be the correct one but copy, cut operations work correctly.
I tried using the script on a Windows 7 Ultimate x64 machine without avail, but the script worked flawlessly on the same machine on Windows 10 x64.
As I haven't logged the error messages myself, and I'm afraid I can't retest it right now, all the feedback about the issue I can give is that PowerShell in Windows 7 may be missing some packages that Powershell has by default on Windows 10 (I think I can recall about not finding something after executing it directly on powershell, and also had this kind of problem before on Windows 7 Powershell).
Thanks in advance for your patience and support and sorry for not giving a more useful debug info, I will try as soon as I can the script on windows 7 again and paste the errors.
Edit:
After some searching, I saw a way of executing old powershells on newer OSes and managed to replicate the errors, so I ran
powershell -Version 2 -File .\HB-DRM-Free_download.ps1
and got this:version 3 works flawlessly, so I guess the script is safe to run in >=Win 8 OSes.
I will update the Windows Management Framework to the latest one and it should work. For compatibility, using
Get-Command cmdletname
returns the path of the cmdlet, and none if it isn't found in that powershell version, all the info I got was from here: StackOverflow is-there-way-to-know-cmdlet-version-in-powershell-for-backward-compatibility.I hope this helps, and thanks in advance.