Skip to content

Correct casing for automatic variables - #11568

Merged
Ilya (iSazonov) merged 35 commits into
PowerShell:masterfrom
xtqqczze:automatic-variables-case
Jan 14, 2020
Merged

Ilya (iSazonov) merged 35 commits into
PowerShell:masterfrom
xtqqczze:automatic-variables-case

Conversation

@xtqqczze

Copy link
Copy Markdown
Contributor

PR Summary

Correct casing for special variables (a.k.a. automatic variables)

PR Context

The following code was used to generate a list of special variables:

[psobject].Assembly.GetType('System.Management.Automation.SpecialVariables').GetFields('NonPublic,Static') |
    Where-Object FieldType -eq ([string]) |
    ForEach-Object GetValue $null |
    Where-Object {$_ -imatch '[a-z].+'}

PR Checklist

@SteveL-MSFT

Copy link
Copy Markdown
Member

This is a large number of files changed. Would be easier to review if you can change one variable per commit.

@xtqqczze

Copy link
Copy Markdown
Contributor Author

Steve Lee (@SteveL-MSFT) OK, I will rewrite

@xtqqczze xtqqczze changed the title Correct casing for automatic variables [WIP]Correct casing for automatic variables Jan 13, 2020
@xtqqczze
xtqqczze force-pushed the automatic-variables-case branch from 698aed5 to 090ad9c Compare January 13, 2020 19:38
@xtqqczze xtqqczze changed the title [WIP]Correct casing for automatic variables Correct casing for automatic variables Jan 13, 2020
@xtqqczze

Copy link
Copy Markdown
Contributor Author

CodeFactor issues are preexisting

@iSazonov Ilya (iSazonov) added the CL-Test Indicates that a PR should be marked as a test change in the Change Log label Jan 14, 2020
@iSazonov Ilya (iSazonov) added this to the 7.1.0-preview.1 milestone Jan 14, 2020
@iSazonov
Ilya (iSazonov) merged commit aefb82a into PowerShell:master Jan 14, 2020
@xtqqczze

Copy link
Copy Markdown
Contributor Author

Ilya (@iSazonov) why not a squash merge?

@TravisEz13

Copy link
Copy Markdown
Member

Ilya (@iSazonov) Yes please use squash commits. I've remove permissions for merge commits.

@iSazonov

Copy link
Copy Markdown
Collaborator

GitHub did return an error after I press Squash and Merge button and show something like "Try again", then ok after refresh. :-(
Merge button was disabled some time ago but then was enabled - I don't know why.

@xtqqczze

Copy link
Copy Markdown
Contributor Author

Opened issue PowerShell/PSScriptAnalyzer#1401 to detect regressions.

@xtqqczze
xtqqczze deleted the automatic-variables-case branch January 22, 2020 16:47
@ghost

Copy link
Copy Markdown

🎉v7.1.0-preview.1 has been released which incorporates this pull request.:tada:

Handy links:

Thatgfsj (Thatgfsj) pushed a commit to Thatgfsj-contribs/PowerShell that referenced this pull request Aug 6, 2026
* Remove BOM, insert newline at EOF

* Correct case of $MyInvocation special variable

* Correct case of $OFS special variable

* Correct case of $NestedPromptLevel special variable

* Correct case of $Matches special variable

* Correct case of $LASTEXITCODE special variable

* Correct case of $StackTrace special variable

* Correct case of $args special variable

* Correct case of $this special variable

* Correct case of $input special variable

* Correct case of $PSCmdlet special variable

* Correct case of $error special variable

* Correct case of $PSDefaultParameterValues special variable

* Correct case of $PSScriptRoot special variable

* Correct case of $PWD special variable

* Correct case of $null special variable

* Correct case of $true special variable

* Correct case of $false special variable

* Correct case of $PSModuleAutoLoadingPreference special variable

* Correct case of $IsLinux special variable

* Correct case of $IsMacOS special variable

* Correct case of $IsWindows special variable

* Correct case of $IsCoreCLR special variable

* Correct case of $DebugPreference special variable

* Correct case of $VerbosePreference special variable

* Correct case of $InformationPreference special variable

* Correct case of $ExecutionContext special variable

* Correct case of $HOME special variable

* Correct case of $Host special variable

* Correct case of $PID special variable

* Correct case of $PSCulture special variable

* Correct case of $PSHOME special variable

* Correct case of $PSUICulture special variable

* Correct case of $PSVersionTable special variable

* Fix false positives
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CL-Test Indicates that a PR should be marked as a test change in the Change Log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants