You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The PowerShell installer uses the cmdlet New-TemporaryFile, which was introduced in PowerShell Core (v6). Because of that, the $temp var doesn't get populated and the download does not happen.
You need to do at least one of the following to fix:
Put a note in the documentation that says to use Pwsh (PowerShell core 6+)
Put a #Requires -Version 6 in the get.ps1 file
Put in custom $PSVersionTable validation and error message that lets people know why it won't run on PowerShell 5 and below
Remove cmdlets such as New-TemporaryFile that are only available in PowerShell core
Personally, I'd suggest telling people to only use it on Pwsh 7+ since 6 is already deprecated. I'd suggest doing #1 and #2 (but for 7 instead of 6). Option 4 is also nice if you actually intend for this to be installable without Pwsh on the machine. New-temporaryFile is likely the only thing that would need changed. Option 3 would only be the case if you're worried that this error message is too generic and hard to under stand: The script '...' cannot be run because it contained a "#requires" statement for PowerShell 7.0. The version of PowerShell that is required by the script does not match the currently running version of PowerShell 5.1.
If you tell me what direction you'd like to go, I'll happily submit a PR.
The text was updated successfully, but these errors were encountered:
The PowerShell installer uses the cmdlet New-TemporaryFile, which was introduced in PowerShell Core (v6). Because of that, the $temp var doesn't get populated and the download does not happen.
You need to do at least one of the following to fix:
#Requires -Version 6
in the get.ps1 filePersonally, I'd suggest telling people to only use it on Pwsh 7+ since 6 is already deprecated. I'd suggest doing #1 and #2 (but for 7 instead of 6). Option 4 is also nice if you actually intend for this to be installable without Pwsh on the machine. New-temporaryFile is likely the only thing that would need changed. Option 3 would only be the case if you're worried that this error message is too generic and hard to under stand:
The script '...' cannot be run because it contained a "#requires" statement for PowerShell 7.0. The version of PowerShell that is required by the script does not match the currently running version of PowerShell 5.1.
If you tell me what direction you'd like to go, I'll happily submit a PR.
The text was updated successfully, but these errors were encountered: