René's URL Explorer Experiment


Title: Push locals of automatic variables to 'DottedScopes' when dotting script cmdlets by daxian-dbw · Pull Request #4709 · PowerShell/PowerShell · GitHub

Open Graph Title: Push locals of automatic variables to 'DottedScopes' when dotting script cmdlets by daxian-dbw · Pull Request #4709 · PowerShell/PowerShell

X Title: Push locals of automatic variables to 'DottedScopes' when dotting script cmdlets by daxian-dbw · Pull Request #4709 · PowerShell/PowerShell

Description: Fix #4688 When dotting a script cmdlet, the locals of automatic variables from the PSScriptCmdlet is not set up in the current scope before parameter binding. The fix is to push the locals in CommandProcessor.OnSetCurrentScope and pop them in CommandProcessor.OnRestorePreviousScope, which will be called from SetCurrentScopeToExecutionScope and RestorePreviousScope respectively. Summary of changes: When a new local scope is used, currently we set the locals for CommandProcessor right before parameter binding (in BindCommandLineParametersNoValidation); we set the locals for ScriptCommandProcessor in Prepare. I moved both to the constructor, right after the new scope is created so that the code is more consistent. In CmdletParameterBinderController.cs, we set up the PSBoundParameters and MyInvocation variables in HandleCommandLineDynamicParameters again, which I think is unnecessary because this method is only called from BindCommandLineParametersNoValidation, where the setup is done for the first time. Currently, the locals will be set for dotted script cmdlet in EnterScope() and ExitScope(). Now, that logic is moved to OnSetCurrentScope and OnRestorePreviousScope of CommandProcessor. This not only makes sure that locals are set before parameter binding, but also is consistent with the ScriptCommandProcessor.

Open Graph Description: Fix #4688 When dotting a script cmdlet, the locals of automatic variables from the PSScriptCmdlet is not set up in the current scope before parameter binding. The fix is to push the locals in Comma...

X Description: Fix #4688 When dotting a script cmdlet, the locals of automatic variables from the PSScriptCmdlet is not set up in the current scope before parameter binding. The fix is to push the locals in Comma...

Opengraph URL: https://github.com/PowerShell/PowerShell/pull/4709

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:42c7a339-e5c5-a928-d93a-32ac8f89b303
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id951C:3E9CB8:5433A5:7A545F:6A57866D
html-safe-nonce4d51312ec6b19659fdc0316abb3be0299fc1f1121644b209f53bf0cad9b3d7cb
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NTFDOjNFOUNCODo1NDMzQTU6N0E1NDVGOjZBNTc4NjZEIiwidmlzaXRvcl9pZCI6IjcwMDIzOTAxNDMxODgwMjU0MSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac91af15f86eb7428202f0d78fdbe8741c27c4dad59137bb6c59eab5a0c436665f
hovercard-subject-tagpull_request:138522248
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/PowerShell/pull/4709/files
twitter:imagehttps://avatars.githubusercontent.com/u/127450?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/127450?s=400&v=4
og:image:altFix #4688 When dotting a script cmdlet, the locals of automatic variables from the PSScriptCmdlet is not set up in the current scope before parameter binding. The fix is to push the locals in Comma...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Nonec6353e56e94423c9cd5abde7708a859afa36a0c1203c73749055bf6ee6704cd0
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/PowerShell/PowerShell git https://github.com/PowerShell/PowerShell.git
octolytics-dimension-user_id11524380
octolytics-dimension-user_loginPowerShell
octolytics-dimension-repository_id49609581
octolytics-dimension-repository_nwoPowerShell/PowerShell
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id49609581
octolytics-dimension-repository_network_root_nwoPowerShell/PowerShell
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
releasef59ab1c46b638204e2aea09126d089be5dc773b7
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/PowerShell/PowerShell/pull/4709/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FPowerShell%2FPowerShell%2Fpull%2F4709%2Ffiles
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
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
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://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
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FPowerShell%2FPowerShell%2Fpull%2F4709%2Ffiles
Sign up https://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%2FPowerShell
Reloadhttps://github.com/PowerShell/PowerShell/pull/4709/files
Reloadhttps://github.com/PowerShell/PowerShell/pull/4709/files
Reloadhttps://github.com/PowerShell/PowerShell/pull/4709/files
Please reload this pagehttps://github.com/PowerShell/PowerShell/pull/4709/files
PowerShell https://github.com/PowerShell
PowerShellhttps://github.com/PowerShell/PowerShell
Notifications https://github.com/login?return_to=%2FPowerShell%2FPowerShell
Fork 8.4k https://github.com/login?return_to=%2FPowerShell%2FPowerShell
Star 54.4k https://github.com/login?return_to=%2FPowerShell%2FPowerShell
Code https://github.com/PowerShell/PowerShell
Issues 1.2k https://github.com/PowerShell/PowerShell/issues
Pull requests 288 https://github.com/PowerShell/PowerShell/pulls
Discussions https://github.com/PowerShell/PowerShell/discussions
Actions https://github.com/PowerShell/PowerShell/actions
Projects https://github.com/PowerShell/PowerShell/projects
Security and quality 3 https://github.com/PowerShell/PowerShell/security
Insights https://github.com/PowerShell/PowerShell/pulse
Code https://github.com/PowerShell/PowerShell
Issues https://github.com/PowerShell/PowerShell/issues
Pull requests https://github.com/PowerShell/PowerShell/pulls
Discussions https://github.com/PowerShell/PowerShell/discussions
Actions https://github.com/PowerShell/PowerShell/actions
Projects https://github.com/PowerShell/PowerShell/projects
Security and quality https://github.com/PowerShell/PowerShell/security
Insights https://github.com/PowerShell/PowerShell/pulse
Sign up for GitHub https://github.com/signup?return_to=%2FPowerShell%2FPowerShell%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2FPowerShell%2FPowerShell%2Fissues%2Fnew%2Fchoose
daxian-dbwhttps://github.com/daxian-dbw
PowerShell:masterhttps://github.com/PowerShell/PowerShell/tree/master
daxian-dbw:dotsourcehttps://github.com/daxian-dbw/PowerShell/tree/dotsource
Conversation 1 https://github.com/PowerShell/PowerShell/pull/4709
Commits 1 https://github.com/PowerShell/PowerShell/pull/4709/commits
Checks 0 https://github.com/PowerShell/PowerShell/pull/4709/checks
Files changed https://github.com/PowerShell/PowerShell/pull/4709/files
Please reload this pagehttps://github.com/PowerShell/PowerShell/pull/4709/files
Push locals of automatic variables to 'DottedScopes' when dotting script cmdlets https://github.com/PowerShell/PowerShell/pull/4709/files#top
Show all changes 1 commit https://github.com/PowerShell/PowerShell/pull/4709/files
0db62b1 Push locals of automatic variables to 'DottedScopes' when dotting scr… daxian-dbw Aug 30, 2017 https://github.com/PowerShell/PowerShell/pull/4709/commits/0db62b19c3090e3a72a3fe05b4791589c80b632c
Clear filters https://github.com/PowerShell/PowerShell/pull/4709/files
Please reload this pagehttps://github.com/PowerShell/PowerShell/pull/4709/files
Please reload this pagehttps://github.com/PowerShell/PowerShell/pull/4709/files
CmdletParameterBinderController.cs https://github.com/PowerShell/PowerShell/pull/4709/files#diff-615448789c060ae3d366101e28f8a865ef104339f272c552dffbb4af7472703d
CommandProcessor.cs https://github.com/PowerShell/PowerShell/pull/4709/files#diff-df20c741725a04d0751f16d65db9cb0818b910b70f5697df098908a0200f62fc
ScriptCommandProcessor.cs https://github.com/PowerShell/PowerShell/pull/4709/files#diff-6e89b65ac27e79a15a4ffb865f4d56068ae104c737d771d0348e1ffa76203b9e
CompiledScriptBlock.cs https://github.com/PowerShell/PowerShell/pull/4709/files#diff-c6bdfa9993fe66f846ea6a07d454a419090e0bae491fc7b5c625472dc2289d35
ParameterBinding.Tests.ps1 https://github.com/PowerShell/PowerShell/pull/4709/files#diff-10a0c4849a47531a5bc355df33333957e78d652371180734296630b7de55dde9
https://github.com/PowerShell/PowerShell/blob/master/.github/CODEOWNERS#L7
src/System.Management.Automation/engine/CmdletParameterBinderController.cshttps://github.com/PowerShell/PowerShell/pull/4709/files#diff-615448789c060ae3d366101e28f8a865ef104339f272c552dffbb4af7472703d
View file https://github.com/daxian-dbw/PowerShell/blob/0db62b19c3090e3a72a3fe05b4791589c80b632c/src/System.Management.Automation/engine/CmdletParameterBinderController.cs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/PowerShell/PowerShell/pull/4709/{{ revealButtonHref }}
https://github.com/PowerShell/PowerShell/pull/4709/files#diff-615448789c060ae3d366101e28f8a865ef104339f272c552dffbb4af7472703d
https://github.com/PowerShell/PowerShell/pull/4709/files#diff-615448789c060ae3d366101e28f8a865ef104339f272c552dffbb4af7472703d
https://github.com/PowerShell/PowerShell/pull/4709/files#diff-615448789c060ae3d366101e28f8a865ef104339f272c552dffbb4af7472703d
https://github.com/PowerShell/PowerShell/pull/4709/files#diff-615448789c060ae3d366101e28f8a865ef104339f272c552dffbb4af7472703d
https://github.com/PowerShell/PowerShell/blob/master/.github/CODEOWNERS#L7
src/System.Management.Automation/engine/CommandProcessor.cshttps://github.com/PowerShell/PowerShell/pull/4709/files#diff-df20c741725a04d0751f16d65db9cb0818b910b70f5697df098908a0200f62fc
View file https://github.com/daxian-dbw/PowerShell/blob/0db62b19c3090e3a72a3fe05b4791589c80b632c/src/System.Management.Automation/engine/CommandProcessor.cs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/PowerShell/PowerShell/pull/4709/{{ revealButtonHref }}
https://github.com/PowerShell/PowerShell/pull/4709/files#diff-df20c741725a04d0751f16d65db9cb0818b910b70f5697df098908a0200f62fc
https://github.com/PowerShell/PowerShell/pull/4709/files#diff-df20c741725a04d0751f16d65db9cb0818b910b70f5697df098908a0200f62fc
https://github.com/PowerShell/PowerShell/pull/4709/files#diff-df20c741725a04d0751f16d65db9cb0818b910b70f5697df098908a0200f62fc
https://github.com/PowerShell/PowerShell/pull/4709/files#diff-df20c741725a04d0751f16d65db9cb0818b910b70f5697df098908a0200f62fc
https://github.com/PowerShell/PowerShell/blob/master/.github/CODEOWNERS#L7
src/System.Management.Automation/engine/ScriptCommandProcessor.cshttps://github.com/PowerShell/PowerShell/pull/4709/files#diff-6e89b65ac27e79a15a4ffb865f4d56068ae104c737d771d0348e1ffa76203b9e
View file https://github.com/daxian-dbw/PowerShell/blob/0db62b19c3090e3a72a3fe05b4791589c80b632c/src/System.Management.Automation/engine/ScriptCommandProcessor.cs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/PowerShell/PowerShell/pull/4709/{{ revealButtonHref }}
https://github.com/PowerShell/PowerShell/pull/4709/files#diff-6e89b65ac27e79a15a4ffb865f4d56068ae104c737d771d0348e1ffa76203b9e
https://github.com/PowerShell/PowerShell/pull/4709/files#diff-6e89b65ac27e79a15a4ffb865f4d56068ae104c737d771d0348e1ffa76203b9e
https://github.com/PowerShell/PowerShell/pull/4709/files#diff-6e89b65ac27e79a15a4ffb865f4d56068ae104c737d771d0348e1ffa76203b9e
https://github.com/PowerShell/PowerShell/pull/4709/files#diff-6e89b65ac27e79a15a4ffb865f4d56068ae104c737d771d0348e1ffa76203b9e
https://github.com/PowerShell/PowerShell/pull/4709/files#diff-6e89b65ac27e79a15a4ffb865f4d56068ae104c737d771d0348e1ffa76203b9e
https://github.com/PowerShell/PowerShell/pull/4709/files#diff-6e89b65ac27e79a15a4ffb865f4d56068ae104c737d771d0348e1ffa76203b9e
https://github.com/PowerShell/PowerShell/blob/master/.github/CODEOWNERS#L7
src/System.Management.Automation/engine/runtime/CompiledScriptBlock.cshttps://github.com/PowerShell/PowerShell/pull/4709/files#diff-c6bdfa9993fe66f846ea6a07d454a419090e0bae491fc7b5c625472dc2289d35
View file https://github.com/daxian-dbw/PowerShell/blob/0db62b19c3090e3a72a3fe05b4791589c80b632c/src/System.Management.Automation/engine/runtime/CompiledScriptBlock.cs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/PowerShell/PowerShell/pull/4709/{{ revealButtonHref }}
https://github.com/PowerShell/PowerShell/pull/4709/files#diff-c6bdfa9993fe66f846ea6a07d454a419090e0bae491fc7b5c625472dc2289d35
https://github.com/PowerShell/PowerShell/pull/4709/files#diff-c6bdfa9993fe66f846ea6a07d454a419090e0bae491fc7b5c625472dc2289d35
https://github.com/PowerShell/PowerShell/pull/4709/files#diff-c6bdfa9993fe66f846ea6a07d454a419090e0bae491fc7b5c625472dc2289d35
https://github.com/PowerShell/PowerShell/pull/4709/files#diff-c6bdfa9993fe66f846ea6a07d454a419090e0bae491fc7b5c625472dc2289d35
https://github.com/PowerShell/PowerShell/blob/master/.github/CODEOWNERS#L7
test/powershell/engine/ParameterBinding/ParameterBinding.Tests.ps1https://github.com/PowerShell/PowerShell/pull/4709/files#diff-10a0c4849a47531a5bc355df33333957e78d652371180734296630b7de55dde9
View file https://github.com/daxian-dbw/PowerShell/blob/0db62b19c3090e3a72a3fe05b4791589c80b632c/test/powershell/engine/ParameterBinding/ParameterBinding.Tests.ps1
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/PowerShell/PowerShell/pull/4709/{{ revealButtonHref }}
https://github.com/PowerShell/PowerShell/pull/4709/files#diff-10a0c4849a47531a5bc355df33333957e78d652371180734296630b7de55dde9
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.