René's URL Explorer Experiment


Title: Add new AvoidUsingArrayList rule by iRon7 · Pull Request #2174 · PowerShell/PSScriptAnalyzer · GitHub

Open Graph Title: Add new AvoidUsingArrayList rule by iRon7 · Pull Request #2174 · PowerShell/PSScriptAnalyzer

X Title: Add new AvoidUsingArrayList rule by iRon7 · Pull Request #2174 · PowerShell/PSScriptAnalyzer

Description: This rule checks for the creation of an ArrayList collection. The ArrayList class is a non-generic collection that can hold objects of any type. This is in line with the fact that PowerShell is a weakly typed language. However, the ArrayList class does not provide any explicit type safety and performance benefits of generic collections. Instead of using an ArrayList, consider using either a System.Collections.Generic.List[Object] class or a fixed PowerShell array. Besides, the ArrayList.Add method returns the index of the added element which often unintentionally pollutes the PowerShell pipeline and therefore might cause unexpected issues. Closes: #2147 PR Checklist PR has a meaningful title Use the present tense and imperative mood when describing your changes Summarized changes Change is not breaking Make sure all .cs, .ps1 and .psm1 files have the correct copyright header Make sure you've added a new test if existing tests do not effectively test the code changed and/or updated documentation This PR is ready to merge and is not Work in Progress. If the PR is work in progress, please add the prefix WIP: to the beginning of the title and remove the prefix when the PR is ready.

Open Graph Description: This rule checks for the creation of an ArrayList collection. The ArrayList class is a non-generic collection that can hold objects of any type. This is in line with the fact that PowerShell is a ...

X Description: This rule checks for the creation of an ArrayList collection. The ArrayList class is a non-generic collection that can hold objects of any type. This is in line with the fact that PowerShell is a ...

Opengraph URL: https://github.com/PowerShell/PSScriptAnalyzer/pull/2174

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:ca28929d-aa1e-2e2f-1384-93827c0965f2
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idD170:118228:1B3FE96:26021BB:6AFD093A
html-safe-nonce162ec9dc9ac4206f3a49419261d887fb341d23c243db4b5dea40b3e7ffeb5f6d
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMTcwOjExODIyODoxQjNGRTk2OjI2MDIxQkI6NkFGRDA5M0EiLCJ2aXNpdG9yX2lkIjoiMzY4ODQ0MTI4NDc5MzI3MjYzNCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacc754d197aa64050613060f524db3835a75299882d8012bd384b1502d3b5440cd
hovercard-subject-tagpull_request:3532294154
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/PowerShell/PSScriptAnalyzer/pull/2174/files
twitter:imagehttps://avatars.githubusercontent.com/u/8080834?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/8080834?s=400&v=4
og:image:altThis rule checks for the creation of an ArrayList collection. The ArrayList class is a non-generic collection that can hold objects of any type. This is in line with the fact that PowerShell is a ...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Noneb29de2abb97b6307b16270785efeb58b51a117d5a9b659acf00b77aa00e7043b
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/PowerShell/PSScriptAnalyzer git https://github.com/PowerShell/PSScriptAnalyzer.git
octolytics-dimension-user_id11524380
octolytics-dimension-user_loginPowerShell
octolytics-dimension-repository_id33149177
octolytics-dimension-repository_nwoPowerShell/PSScriptAnalyzer
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id33149177
octolytics-dimension-repository_network_root_nwoPowerShell/PSScriptAnalyzer
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release8c9e619def6d670dc18a45d3b02cea938c1c7e47
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/PowerShell/PSScriptAnalyzer/pull/2174/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FPowerShell%2FPSScriptAnalyzer%2Fpull%2F2174%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FPowerShell%2FPSScriptAnalyzer%2Fpull%2F2174%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=PowerShell%2FPSScriptAnalyzer
Reloadhttps://github.com/PowerShell/PSScriptAnalyzer/pull/2174/files
Reloadhttps://github.com/PowerShell/PSScriptAnalyzer/pull/2174/files
Reloadhttps://github.com/PowerShell/PSScriptAnalyzer/pull/2174/files
PowerShellhttps://github.com/PowerShell
PSScriptAnalyzerhttps://github.com/PowerShell/PSScriptAnalyzer
Codehttps://github.com/PowerShell/PSScriptAnalyzer
Issues407 (407)https://github.com/PowerShell/PSScriptAnalyzer/issues
Pull requests34 (34)https://github.com/PowerShell/PSScriptAnalyzer/pulls
Discussionshttps://github.com/PowerShell/PSScriptAnalyzer/discussions
Actionshttps://github.com/PowerShell/PSScriptAnalyzer/actions
Projectshttps://github.com/PowerShell/PSScriptAnalyzer/projects
Wikihttps://github.com/PowerShell/PSScriptAnalyzer/wiki
Security and qualityhttps://github.com/PowerShell/PSScriptAnalyzer/security
Insightshttps://github.com/PowerShell/PSScriptAnalyzer/insights
Sign up for GitHub https://github.com/signup?return_to=%2FPowerShell%2FPSScriptAnalyzer%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2FPowerShell%2FPSScriptAnalyzer%2Fissues%2Fnew%2Fchoose
Andy Jordan (andyleejordan)https://github.com/andyleejordan
PowerShell:mainhttps://github.com/PowerShell/PSScriptAnalyzer/tree/main
iRon7:#2147AvoidArrayListhttps://github.com/iRon7/PSScriptAnalyzer/tree/%232147AvoidArrayList
Conversation 53 https://github.com/PowerShell/PSScriptAnalyzer/pull/2174
Commits 24 https://github.com/PowerShell/PSScriptAnalyzer/pull/2174/commits
Checks 4 https://github.com/PowerShell/PSScriptAnalyzer/pull/2174/checks
Files changed https://github.com/PowerShell/PSScriptAnalyzer/pull/2174/files
Please reload this pagehttps://github.com/PowerShell/PSScriptAnalyzer/pull/2174/files
Add new AvoidUsingArrayList rule https://github.com/PowerShell/PSScriptAnalyzer/pull/2174/files#top
Show all changes 24 commits https://github.com/PowerShell/PSScriptAnalyzer/pull/2174/files
c34eb23 Implemented the AvoidUsingArrayList rule to warn when the ArrayList c… iRon7 Apr 14, 2026 https://github.com/PowerShell/PSScriptAnalyzer/pull/2174/commits/c34eb236b4571eff1d820f0506646fa13e890445
ba1167d Testing-Commit-CSpell-issue iRon7 Apr 16, 2026 https://github.com/PowerShell/PSScriptAnalyzer/pull/2174/commits/ba1167d577989d302f71c2a2d6ea09d25de20101
77384e1 Apply suggestion from @liamjpeters iRon7 Apr 16, 2026 https://github.com/PowerShell/PSScriptAnalyzer/pull/2174/commits/77384e11bb0b43c2dfd06e0007cd6fd0cb5ac168
77d1e6d Update docs/Rules/AvoidUsingArrayList.md iRon7 Apr 16, 2026 https://github.com/PowerShell/PSScriptAnalyzer/pull/2174/commits/77d1e6dac8b90ccf54324b431ebf2c5fb5be69a9
d9b88a8 Updated rule help iRon7 Apr 16, 2026 https://github.com/PowerShell/PSScriptAnalyzer/pull/2174/commits/d9b88a8b23b29315660a76f85e3c863128fe5dd7
1eb92e9 Merge branch '#2147AvoidArrayList' of https://github.com/iRon7/PSScri… iRon7 Apr 16, 2026 https://github.com/PowerShell/PSScriptAnalyzer/pull/2174/commits/1eb92e978969ad415401f8220eb1bfdd80574ca0
c0aa82b Changed "unintentionally" iRon7 Apr 16, 2026 https://github.com/PowerShell/PSScriptAnalyzer/pull/2174/commits/c0aa82b322e60abd05b085338193258af2fdc0e6
7bc3dfa Update Rules/AvoidUsingArrayList.cs iRon7 Apr 16, 2026 https://github.com/PowerShell/PSScriptAnalyzer/pull/2174/commits/7bc3dfad148607267983984ccaee1c22a962470b
b35becb Update Tests/Rules/AvoidUsingArrayList.tests.ps1 iRon7 Apr 16, 2026 https://github.com/PowerShell/PSScriptAnalyzer/pull/2174/commits/b35becb93524dad85cc06bb1ed07b589168f9d9e
9ed1355 ArrayListName could be null iRon7 Apr 16, 2026 https://github.com/PowerShell/PSScriptAnalyzer/pull/2174/commits/9ed13550f6c80a2457113f44c7eda0f200fc8cce
e1362e6 Resolved camelCase iRon7 Apr 16, 2026 https://github.com/PowerShell/PSScriptAnalyzer/pull/2174/commits/e1362e62c006d7bd5bfa97a2a9b5d05df659e31e
b80f01c Remove ComponentModel namespace iRon7 Apr 16, 2026 https://github.com/PowerShell/PSScriptAnalyzer/pull/2174/commits/b80f01c8d00821bb6ac3f8af2f884cb0c58ae4d6
f913b1f Fixed tests iRon7 Apr 16, 2026 https://github.com/PowerShell/PSScriptAnalyzer/pull/2174/commits/f913b1f058af6637f9ccccbc074859fad52bc4a8
b3a5c3c Updated Tests iRon7 Apr 16, 2026 https://github.com/PowerShell/PSScriptAnalyzer/pull/2174/commits/b3a5c3cb3639dab0e0e84e8b4fd2071b386f055e
8aefe4c fixed and tested empty (dynamic) BoundParameter iRon7 Apr 16, 2026 https://github.com/PowerShell/PSScriptAnalyzer/pull/2174/commits/8aefe4c0189bd0cd0f2a0e0bb3ff9ee62bc2338b
ad49041 Robuster Pester tests iRon7 Apr 17, 2026 https://github.com/PowerShell/PSScriptAnalyzer/pull/2174/commits/ad49041630c6dcda86781285e009b8fb237b0a66
4bc41e9 Configurable (enable by default) iRon7 Apr 18, 2026 https://github.com/PowerShell/PSScriptAnalyzer/pull/2174/commits/4bc41e9ff0196c49b91605ec69483adeb37ced18
fb27627 Fixed ConstantValue null check test and rule iRon7 Apr 21, 2026 https://github.com/PowerShell/PSScriptAnalyzer/pull/2174/commits/fb27627a7329855279c6a7ee89c3d6d25ae7627d
5a66672 Merge branch 'main' into #2147AvoidArrayList iRon7 May 5, 2026 https://github.com/PowerShell/PSScriptAnalyzer/pull/2174/commits/5a66672b7fb7479b7bd94c92b6fb56f2509a51e7
973d2e7 Better UsingStatements handling and disable AvoidUsingArrayList by de… iRon7 May 6, 2026 https://github.com/PowerShell/PSScriptAnalyzer/pull/2174/commits/973d2e7f356e6ca5ea605a08bb47caa35acb7485
14ed9f5 `[ArrayList]::new()` without a `using namespace System.Collections` iRon7 May 6, 2026 https://github.com/PowerShell/PSScriptAnalyzer/pull/2174/commits/14ed9f531c4cc3d7efe80fc70a1a97974b780711
2a46b7f Potential fix for pull request finding iRon7 May 11, 2026 https://github.com/PowerShell/PSScriptAnalyzer/pull/2174/commits/2a46b7f0cd6553b31c8f195166f63e37abbb975b
0646b3d Resolve Copilot suggestions and resolved `Method not found: ScriptBlo… iRon7 May 11, 2026 https://github.com/PowerShell/PSScriptAnalyzer/pull/2174/commits/0646b3d9fea538dbe740b2cb70ae477bd466037a
49a1a55 Merge branch 'main' into #2147AvoidArrayList iRon7 May 17, 2026 https://github.com/PowerShell/PSScriptAnalyzer/pull/2174/commits/49a1a550babc2ec0689be6c465e50ab32fe4250f
Clear filters https://github.com/PowerShell/PSScriptAnalyzer/pull/2174/files
Please reload this pagehttps://github.com/PowerShell/PSScriptAnalyzer/pull/2174/files
Please reload this pagehttps://github.com/PowerShell/PSScriptAnalyzer/pull/2174/files
AvoidUsingArrayList.cs https://github.com/PowerShell/PSScriptAnalyzer/pull/2174/files#diff-1574aaa0372190bbe7bd9d34922b8d4ca3fd5ce2fd244bd2055efd7c9d113ea3
Strings.resx https://github.com/PowerShell/PSScriptAnalyzer/pull/2174/files#diff-dcff94e6a5c5ee1dc9226dea0752aba08f8f1f53020b4a0e67f1ac944036b8c3
AvoidUsingArrayList.tests.ps1 https://github.com/PowerShell/PSScriptAnalyzer/pull/2174/files#diff-dd899fdc9b9d5bc8092bdfadae6e530cb340a3bcd2440c807d7610e4f1ff5d47
AvoidUsingArrayList.md https://github.com/PowerShell/PSScriptAnalyzer/pull/2174/files#diff-4d208f2d06c2109235286c9b7c3d5f886a9d361c4b804610305e048babe8149f
README.md https://github.com/PowerShell/PSScriptAnalyzer/pull/2174/files#diff-aa3ee3522a3ec73c6f36f2fe020f02ee8517299d57cfe67d99ff0efd2038a0d5
https://github.com/PowerShell/PSScriptAnalyzer/blob/main/.github/CODEOWNERS#L2
Rules/AvoidUsingArrayList.cshttps://github.com/PowerShell/PSScriptAnalyzer/pull/2174/files#diff-1574aaa0372190bbe7bd9d34922b8d4ca3fd5ce2fd244bd2055efd7c9d113ea3
View file https://github.com/iRon7/PSScriptAnalyzer/blob/49a1a550babc2ec0689be6c465e50ab32fe4250f/Rules/AvoidUsingArrayList.cs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/PowerShell/PSScriptAnalyzer/pull/2174/{{ revealButtonHref }}
Please reload this pagehttps://github.com/PowerShell/PSScriptAnalyzer/pull/2174/files
Please reload this pagehttps://github.com/PowerShell/PSScriptAnalyzer/pull/2174/files
Please reload this pagehttps://github.com/PowerShell/PSScriptAnalyzer/pull/2174/files
https://github.com/PowerShell/PSScriptAnalyzer/blob/main/.github/CODEOWNERS#L2
Rules/Strings.resxhttps://github.com/PowerShell/PSScriptAnalyzer/pull/2174/files#diff-dcff94e6a5c5ee1dc9226dea0752aba08f8f1f53020b4a0e67f1ac944036b8c3
View file https://github.com/iRon7/PSScriptAnalyzer/blob/49a1a550babc2ec0689be6c465e50ab32fe4250f/Rules/Strings.resx
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/PowerShell/PSScriptAnalyzer/pull/2174/{{ revealButtonHref }}
https://github.com/PowerShell/PSScriptAnalyzer/pull/2174/files#diff-dcff94e6a5c5ee1dc9226dea0752aba08f8f1f53020b4a0e67f1ac944036b8c3
https://github.com/PowerShell/PSScriptAnalyzer/pull/2174/files#diff-dcff94e6a5c5ee1dc9226dea0752aba08f8f1f53020b4a0e67f1ac944036b8c3
Please reload this pagehttps://github.com/PowerShell/PSScriptAnalyzer/pull/2174/files
Please reload this pagehttps://github.com/PowerShell/PSScriptAnalyzer/pull/2174/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.