René's URL Explorer Experiment


Title: Support CMD-Style Environment Variable Expansion (%VARIABLE%) in PowerShell · Issue #28408 · PowerShell/PowerShell · GitHub

Open Graph Title: Support CMD-Style Environment Variable Expansion (%VARIABLE%) in PowerShell · Issue #28408 · PowerShell/PowerShell

X Title: Support CMD-Style Environment Variable Expansion (%VARIABLE%) in PowerShell · Issue #28408 · PowerShell/PowerShell

Description: Summary of the new feature / enhancement As a PowerShell user and Windows administrator, I would like PowerShell to support both its native $env:VARIABLE syntax and the traditional Windows Command Prompt %VARIABLE% syntax when referencin...

Open Graph Description: Summary of the new feature / enhancement As a PowerShell user and Windows administrator, I would like PowerShell to support both its native $env:VARIABLE syntax and the traditional Windows Command ...

X Description: Summary of the new feature / enhancement As a PowerShell user and Windows administrator, I would like PowerShell to support both its native $env:VARIABLE syntax and the traditional Windows Command ...

Opengraph URL: https://github.com/PowerShell/PowerShell/issues/28408

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Support CMD-Style Environment Variable Expansion (%VARIABLE%) in PowerShell","articleBody":"### Summary of the new feature / enhancement\n\nAs a PowerShell user and Windows administrator, I would like PowerShell to support both its native `$env:VARIABLE` syntax and the traditional Windows Command Prompt `%VARIABLE%` syntax when referencing environment variables in commands and scripts.\n\nFor example, both of the following would resolve to the same environment variable value:\n\n```powershell\n$env:USERPROFILE\n%USERPROFILE%\n```\n\n**Reason for the request:**\n\nWindows documentation, administrative utilities, installation instructions, and configuration interfaces frequently reference environment variables using the traditional `%VARIABLE%` notation.\n\nFor example, Windows Defender Firewall supports environment variables such as `%windir%` when specifying application paths in firewall rules.\n\nHowever, when working in PowerShell, administrators must translate these references into PowerShell's `$env:VARIABLE` syntax or explicitly expand them using another method.\n\nSupporting both syntaxes would:\n\n- Improve consistency between PowerShell, Command Prompt, and Windows administrative interfaces.\n- Make it easier to copy and adapt commands and paths from existing Windows documentation.\n- Reduce the need to manually translate environment variable references.\n- Improve usability for administrators and learners transitioning from Command Prompt to PowerShell.\n- Allow existing Windows-style paths containing environment variables to be used more naturally in PowerShell commands and scripts.\n\nThe intent is not to replace PowerShell's existing environment variable syntax, but to provide additional compatibility and flexibility when working with Windows environment variables.\n\n### Proposed technical implementation details (optional)\n\nIdeally, PowerShell would recognize and expand `%VARIABLE%` references in addition to its existing `$env:VARIABLE` syntax.\n\nFor example:\n\n**Current PowerShell behavior:**\n\n```powershell\nWrite-Output $env:USERPROFILE\nGet-Item \"$env:WINDIR\\System32\"\n```\n\n**Proposed additional syntax:**\n\n```powershell\nWrite-Output %USERPROFILE%\nGet-Item \"%WINDIR%\\System32\"\n```\n\nBoth forms should produce equivalent results.\n\nThis capability could also support variable expansion within strings:\n\n```powershell\n$Path = \"%ProgramData%\\MyApplication\\Logs\"\n```\n\nPowerShell already provides similar functionality through .NET:\n\n```powershell\n[Environment]::ExpandEnvironmentVariables(\n    '%ProgramData%\\MyApplication\\Logs'\n)\n```\n\nAdditionally, PowerShell currently recognizes `%VARIABLE%` references when using the `--%` stop-parsing token with native Windows commands.\n\nThe proposed enhancement would make this functionality more accessible within normal PowerShell usage, without requiring explicit .NET method calls or the stop-parsing token.\n\n**Compatibility considerations:**\n\nI recognize that introducing additional variable expansion syntax could affect existing scripts that intentionally use literal percent-delimited strings.\n\nPotential approaches could include:\n\n- Providing the functionality through an opt-in experimental feature or preference setting to preserve backward compatibility.\n- Following PowerShell's existing quoting conventions, where single-quoted strings remain literal.\n- Clearly defining behavior when a referenced environment variable does not exist.\n- Initially limiting the enhancement to Windows, where this notation is widely used.\n\nThe specific implementation should be determined by the PowerShell team, with an emphasis on maintaining backward compatibility while improving usability.\n\nThe primary objective is to allow administrators to use either environment variable notation naturally within PowerShell commands and scripts.","author":{"url":"https://github.com/darienhawkins","@type":"Person","name":"darienhawkins"},"datePublished":"2026-11-12T18:05:20Z","url":"https://github.com/PowerShell/PowerShell/issues/28408"}

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/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:55cc90ad-fd0d-e412-165b-bf3c46e9ad17
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idBF76:3046F7:417645:565617:6AFCE972
html-safe-nonce1a2cb92f99b7d2b2411ea8decc81bc902038da6322eb0504d5bd5c321a4520e1
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRjc2OjMwNDZGNzo0MTc2NDU6NTY1NjE3OjZBRkNFOTcyIiwidmlzaXRvcl9pZCI6Ijc1NTM5NDg1MTIwMDg4NzE1NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac9391df739a77b3ee90f37eb19c23944b1f5113988d31eb5966f040bf7a4ea1cf
hovercard-subject-tagissue:6356020523
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/PowerShell/PowerShell/28408/issue_layout
twitter:imagehttps://opengraph.githubassets.com/70e38bfa08a8d971b7b8e93ce4b4c06686915d157c355686c8cba6e10a50ce61/PowerShell/PowerShell/issues/28408
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/70e38bfa08a8d971b7b8e93ce4b4c06686915d157c355686c8cba6e10a50ce61/PowerShell/PowerShell/issues/28408
og:image:altSummary of the new feature / enhancement As a PowerShell user and Windows administrator, I would like PowerShell to support both its native $env:VARIABLE syntax and the traditional Windows Command ...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamedarienhawkins
hostnamegithub.com
expected-hostnamegithub.com
None99aede4c5f55ec5cf06666a8c9e03ebf9f85f7231223e7f1c38c16e5504835b3
turbo-cache-controlno-preview
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
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releaseecfd63ca125ec74b42f74eeb158b3fa081c8c497
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/PowerShell/PowerShell/issues/28408#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FPowerShell%2FPowerShell%2Fissues%2F28408
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%2FPowerShell%2Fissues%2F28408
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=PowerShell%2FPowerShell
Reloadhttps://github.com/PowerShell/PowerShell/issues/28408
Reloadhttps://github.com/PowerShell/PowerShell/issues/28408
Reloadhttps://github.com/PowerShell/PowerShell/issues/28408
PowerShellhttps://github.com/PowerShell
PowerShellhttps://github.com/PowerShell/PowerShell
Codehttps://github.com/PowerShell/PowerShell
Issues1.3k (1.3k)https://github.com/PowerShell/PowerShell/issues
Pull requests364 (364)https://github.com/PowerShell/PowerShell/pulls
Discussionshttps://github.com/PowerShell/PowerShell/discussions
Actionshttps://github.com/PowerShell/PowerShell/actions
Projectshttps://github.com/PowerShell/PowerShell/projects
Security and quality3 (3)https://github.com/PowerShell/PowerShell/security
Insightshttps://github.com/PowerShell/PowerShell/insights
https://github.com/PowerShell/PowerShell
New issuehttps://github.com/login?return_to=https://github.com/PowerShell/PowerShell/issues/28408
New issuehttps://github.com/login?return_to=https://github.com/PowerShell/PowerShell/issues/28408
Support CMD-Style Environment Variable Expansion (%VARIABLE%) in PowerShellhttps://github.com/PowerShell/PowerShell/issues/28408#top
Issue-Enhancementthe issue is more of a feature request than a bughttps://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22Issue-Enhancement%22
Needs-TriageThe issue is new and needs to be triaged by a work group.https://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22Needs-Triage%22
https://github.com/darienhawkins
Darien Hawkins (darienhawkins)https://github.com/darienhawkins
on Nov 12, 2026https://github.com/PowerShell/PowerShell/issues/28408#issue-6356020523
Darien Hawkins (darienhawkins)https://github.com/darienhawkins
Issue-Enhancementthe issue is more of a feature request than a bughttps://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22Issue-Enhancement%22
Needs-TriageThe issue is new and needs to be triaged by a work group.https://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22Needs-Triage%22
on Nov 12, 2026https://github.com/PowerShell/PowerShell/issues/28408#event-35945374147
https://github.com/rhubarb-geek-nz
rhubarb-geek-nzhttps://github.com/rhubarb-geek-nz
on Nov 14, 2026https://github.com/PowerShell/PowerShell/issues/28408#issuecomment-6871031907
package.ps1https://github.com/rhubarb-geek-nz/MPWShell/blob/main/package.ps1
https://github.com/rhubarb-geek-nz
rhubarb-geek-nzhttps://github.com/rhubarb-geek-nz
on Nov 15, 2026https://github.com/PowerShell/PowerShell/issues/28408#issuecomment-6890382426
PSGalleryhttps://www.powershellgallery.com/packages/rhubarb-geek-nz.EnvironmentalConcerns/1.0.0
githubhttps://github.com/rhubarb-geek-nz/EnvironmentalConcerns
Sign up for freehttps://github.com/signup?return_to=https://github.com/PowerShell/PowerShell/issues/28408
Sign in to commenthttps://github.com/login?return_to=https://github.com/PowerShell/PowerShell/issues/28408
Issue-Enhancementthe issue is more of a feature request than a bughttps://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22Issue-Enhancement%22
Needs-TriageThe issue is new and needs to be triaged by a work group.https://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22Needs-Triage%22
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.