Skip to content
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

Define $IsWindows if not defined. (IDFGH-6181) #7858

Closed
wants to merge 1 commit into from

Conversation

cmumford
Copy link
Contributor

@cmumford cmumford commented Nov 9, 2021

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.01 which means that IsWindows is guaranteed to be defined on all
non-Windows systems. So, if undefined this indicates a Windows platform.

Footnotes

  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 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
@espressif-bot espressif-bot added the Status: Opened Issue is new label Nov 9, 2021
@github-actions github-actions bot changed the title Define $IsWindows if not defined. Define $IsWindows if not defined. (IDFGH-6181) Nov 9, 2021
@Alvin1Zhang
Copy link
Collaborator

Thanks for your contribution.

@cmumford
Copy link
Contributor Author

cmumford commented Nov 9, 2021

I verified this on PowerShell 5.1.

@dobairoland
Copy link
Collaborator

Great fix @cmumford. Thanks! I move both of your PRs into our test queue. They will be closed when they get merged.

@espressif-bot espressif-bot added Status: In Progress Work is in progress Resolution: NA Issue resolution is unavailable Status: Done Issue is done internally Resolution: Done Issue is done internally and removed Status: Opened Issue is new Status: In Progress Work is in progress Resolution: NA Issue resolution is unavailable labels Nov 9, 2021
@cmumford cmumford deleted the is-windows branch November 13, 2021 15:32
espressif-bot pushed a commit that referenced this pull request Nov 20, 2021
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
espressif-bot pushed a commit that referenced this pull request Nov 24, 2021
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: Done Issue is done internally Status: Done Issue is done internally
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The export.ps1 script used undefined variable: $IsWindows (IDFGH-6141)
4 participants