-
Notifications
You must be signed in to change notification settings - Fork 7.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The export.ps1
script used undefined variable: $IsWindows
(IDFGH-6141)
#7820
Comments
export.ps1
script used undefined variable: $IsWindows
export.ps1
script used undefined variable: $IsWindows
(IDFGH-6141)
Hi @cmumford. Thanks for the report. Do you know the proper solution for this? IsWindows should been defined on other platform to $False: Shouldn't this be a PowerShell issue? It should not complain about his own internal variable. |
Good point. I didn't know that was built-in. I wonder if I only get that error when I execute the script from another. I'm loading it like this: function SetupESP() {
if (Test-Path ~\esp\esp-idf\export.ps1 -PathType Leaf) {
~\esp\esp-idf\export.ps1
} else {
Write-Warning "No ESP-IDF environment to export"
}
} |
@cmumford I think this issue is caused by old version of PowerShell. The link given above is for 7.1. The variable is missing for version 5.1. I can reproduce this in PowerShell 5.1. Just execute |
Yes, here's my version:
I think I'll submit a PR to set |
Actually it is defined in "PowerShell Core 6 and PowerShell 7", so maybe were OK here. |
The `$IsWindows` PowerShell variable was added in PowerShell Core 6 and PowerShell 7, and is not present in earlier PowerShell versions. Set to true if undefined. This fixes espressif#7820. The first version to run on non-Windows platforms was PowerShell Core 6.0[^1] which means that IsWindows is guaranteed to be defined on all non-Windows systems. So, if undefined this indicates a Windows platform. [^1]: https://docs.microsoft.com/en-us/powershell/scripting/install/powershell-support-lifecycle?view=powershell-7.2#release-history
The `$IsWindows` PowerShell variable was added in PowerShell Core 6 and PowerShell 7, and is not present in earlier PowerShell versions. Set to true if undefined. This fixes #7820. The first version to run on non-Windows platforms was PowerShell Core 6.0[^1] which means that IsWindows is guaranteed to be defined on all non-Windows systems. So, if undefined this indicates a Windows platform. [^1]: https://docs.microsoft.com/en-us/powershell/scripting/install/powershell-support-lifecycle?view=powershell-7.2#release-history Closes #7858 Closes #7820
The `$IsWindows` PowerShell variable was added in PowerShell Core 6 and PowerShell 7, and is not present in earlier PowerShell versions. Set to true if undefined. This fixes #7820. The first version to run on non-Windows platforms was PowerShell Core 6.0[^1] which means that IsWindows is guaranteed to be defined on all non-Windows systems. So, if undefined this indicates a Windows platform. [^1]: https://docs.microsoft.com/en-us/powershell/scripting/install/powershell-support-lifecycle?view=powershell-7.2#release-history Closes #7858 Closes #7820
Environment
git describe --tags
to find it): v4.3.1xtensa-esp32-elf-gcc --version
to find it): N/AProblem Description
$IsWindows
is used, but never defined.Steps to reproduce
Set-PSDebug -strict
./export.ps1
The text was updated successfully, but these errors were encountered: