René's URL Explorer Experiment


Title: [Environment]::SetEnvironmentVariable() fixes and improvements · Issue #26725 · PowerShell/PowerShell · GitHub

Open Graph Title: [Environment]::SetEnvironmentVariable() fixes and improvements · Issue #26725 · PowerShell/PowerShell

X Title: [Environment]::SetEnvironmentVariable() fixes and improvements · Issue #26725 · PowerShell/PowerShell

Description: Summary of the new feature / enhancement [Environment]::SetEnvironmentVariable("Variable", $null) should delete the environmentvariable and when passing [Environment]::SetEnvironmentVariable("Variable", "") it keeps the current behaviour...

Open Graph Description: Summary of the new feature / enhancement [Environment]::SetEnvironmentVariable("Variable", $null) should delete the environmentvariable and when passing [Environment]::SetEnvironmentVariable("Varia...

X Description: Summary of the new feature / enhancement [Environment]::SetEnvironmentVariable("Variable", $null) should delete the environmentvariable and when passing [Environment]::SetEnvironmentVaria...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Environment]::SetEnvironmentVariable() fixes and improvements","articleBody":"### Summary of the new feature / enhancement\n\n1.\n[Environment]::SetEnvironmentVariable(\"Variable\", $null) \nshould  delete the environmentvariable\n\nand when passing [Environment]::SetEnvironmentVariable(\"Variable\", \"\")\nit keeps the current behaviour of setting an empty variable\n\n2.\n[Environment]::GetEnvironmentVariable() add a new optional parameter that can be used to get a variable not expanded\nThis allows to save it to a variable and pass it directly to SetEnvironmentVariable without breaking %% inside variables\n\n3.\nalso for SetEnvironmentVariable it should detect if a % is inside the parameter and set the korrekt registrykey type when saving (reg_expand_sz) currently it always saves as reg_sz which breaks Path variable when used \n\n### Proposed technical implementation details (optional)\n\nhttps://stackoverflow.com/questions/69965728/cannot-remove-powershell-environment-variables\nhere the current behaviour is described.\n\nand for point 3 line 90 in file https://github.com/microsoft/PowerToys/blob/main/src/modules/EnvironmentVariables/EnvironmentVariablesUILib/Helpers/EnvironmentVariablesHelper.cs\n\n1.\nCan the powershell command be adjusted so that when passing\n[Environment]::SetEnvironmentVariable(\"Variable\", $null) \nit should pass [NullString]::Value\nand when passing [Environment]::SetEnvironmentVariable(\"Variable\", '')\nit keeps the current behaviour of empty.string\n\nthe current usage of\nusing [Environment]::SetEnvironmentVariable(\"Variable\", [NullString]::Value)\nis not very convinient or intuitive\n\n\n2.\ncurrently this is how we can get env variables\n[Environment]::GetEnvironmentVariable($Name, $Target)\n\nwe can expand this to be \n[Environment]::GetEnvironmentVariable($Name, $Target, $DoNotExpand)\n\nwhich toggles this behaviour\n\n3.\nIf the value passed to SetEnvironmentVariable($Name, $Value, $Target) contains \"%\" it should save as reg_expand_sz else reg_sz\n\nthis is already the implemented behaviour for EnvironmentVariable Editor inside PowerToys\nand writing the registry directly because of this issue with SetEnvironmentVariable and unable to get Env variable unexpanded with GetEnvironmentVariable","author":{"url":"https://github.com/AkitoTheGambler","@type":"Person","name":"AkitoTheGambler"},"datePublished":"2026-01-26T22:44:18Z","url":"https://github.com/PowerShell/PowerShell/issues/26725"}

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:d86f12ed-c17e-8608-56f0-1f54024519ca
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idA7F6:9E9AB:3CC168:5347D4:6AFD31D6
html-safe-nonce0220da671414e8aae8e36f71838f8c69671a787002f50bfda13246035b4c0c90
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBN0Y2OjlFOUFCOjNDQzE2ODo1MzQ3RDQ6NkFGRDMxRDYiLCJ2aXNpdG9yX2lkIjoiMjg2MTk0NDI2NTQxNDM1NzQ2MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacf8d6253c260500b8b8ae411e52c4cffd219ee371b697c888d12acc8a0feda187
hovercard-subject-tagissue:3857994825
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/26725/issue_layout
twitter:imagehttps://opengraph.githubassets.com/3b283ea61be514e9c90fed99a8716a2f15a88abbfdb681ac74f591957e0a11b6/PowerShell/PowerShell/issues/26725
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/3b283ea61be514e9c90fed99a8716a2f15a88abbfdb681ac74f591957e0a11b6/PowerShell/PowerShell/issues/26725
og:image:altSummary of the new feature / enhancement [Environment]::SetEnvironmentVariable("Variable", $null) should delete the environmentvariable and when passing [Environment]::SetEnvironmentVariable("Varia...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameAkitoTheGambler
hostnamegithub.com
expected-hostnamegithub.com
None065128366c233a9d57ff68ab6c96e25b99dd1b0ab70d23b70873d3dd6b5e4f19
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
release941021edf0c2ec58298f4a2c8f27ae507d129c92
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/PowerShell/PowerShell/issues/26725#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FPowerShell%2FPowerShell%2Fissues%2F26725
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%2F26725
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/26725
Reloadhttps://github.com/PowerShell/PowerShell/issues/26725
Reloadhttps://github.com/PowerShell/PowerShell/issues/26725
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/26725
New issuehttps://github.com/login?return_to=https://github.com/PowerShell/PowerShell/issues/26725
[Environment]::SetEnvironmentVariable() fixes and improvementshttps://github.com/PowerShell/PowerShell/issues/26725#top
.NETPull requests that update .NET codehttps://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22.NET%22
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
Resolution-AnsweredThe question is answered.https://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22Resolution-Answered%22
https://github.com/AkitoTheGambler
Christian Gambale (AkitoTheGambler)https://github.com/AkitoTheGambler
on Jan 26, 2026https://github.com/PowerShell/PowerShell/issues/26725#issue-3857994825
https://stackoverflow.com/questions/69965728/cannot-remove-powershell-environment-variableshttps://stackoverflow.com/questions/69965728/cannot-remove-powershell-environment-variables
https://github.com/microsoft/PowerToys/blob/main/src/modules/EnvironmentVariables/EnvironmentVariablesUILib/Helpers/EnvironmentVariablesHelper.cshttps://github.com/microsoft/PowerToys/blob/main/src/modules/EnvironmentVariables/EnvironmentVariablesUILib/Helpers/EnvironmentVariablesHelper.cs
Christian Gambale (AkitoTheGambler)https://github.com/AkitoTheGambler
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 Jan 26, 2026https://github.com/PowerShell/PowerShell/issues/26725#event-22301960672
https://github.com/mklement0
Michael Klement (mklement0)https://github.com/mklement0
on Jan 27, 2026https://github.com/PowerShell/PowerShell/issues/26725#issuecomment-3802640283
https://github.com/dotnet/runtime/issueshttps://github.com/dotnet/runtime/issues
https://camo.githubusercontent.com/fd1cdf18d48cc52ea77780a2779eb0efbd89de732a1e671cc8d87de4c2493824/68747470733a2f2f6f70656e67726170682e6769746875626173736574732e636f6d2f333662626637646230346662303966343034346364633632656437313463313937393934303738613638366136633835623032366539383630313933346236342f646f746e65742f72756e74696d65
https://camo.githubusercontent.com/7e41d4698b37a89b2a8c06057583a5f48ce614b0fb7e2b93d27a2ec01c8f024b/68747470733a2f2f6769746875622e6769746875626173736574732e636f6d2f66617669636f6e732f66617669636f6e2e737667
dotnet/runtimehttps://github.com/dotnet/runtime
https://github.com/AkitoTheGambler
Christian Gambale (AkitoTheGambler)https://github.com/AkitoTheGambler
on Jan 27, 2026https://github.com/PowerShell/PowerShell/issues/26725#issuecomment-3804301300
Ryan Yates (kilasuit)https://github.com/kilasuit
.NETPull requests that update .NET codehttps://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22.NET%22
Resolution-AnsweredThe question is answered.https://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22Resolution-Answered%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 Jan 27, 2026https://github.com/PowerShell/PowerShell/issues/26725#event-22321767667
https://github.com/SeeminglyScience
Patrick Meinecke (SeeminglyScience)https://github.com/SeeminglyScience
on Jan 27, 2026https://github.com/PowerShell/PowerShell/issues/26725#issuecomment-3806044775
https://github.com/kilasuit
Ryan Yates (kilasuit)https://github.com/kilasuit
on Jan 27, 2026https://github.com/PowerShell/PowerShell/issues/26725#issuecomment-3806055832
this comment in issue 24637https://github.com/PowerShell/PowerShell/issues/24637#issuecomment-2515600276
Working Group commenthttps://github.com/PowerShell/PowerShell/issues/21186#issuecomment-2270067750
Michael Klement (@mklement0)https://github.com/mklement0
https://github.com/kilasuit
Ryan Yates (kilasuit)https://github.com/kilasuit
on Jan 28, 2026https://github.com/PowerShell/PowerShell/issues/26725#issuecomment-3808704853
https://github.com/apps/microsoft-github-policy-service
microsoft-github-policy-servicehttps://github.com/apps/microsoft-github-policy-service
on Jan 29, 2026https://github.com/PowerShell/PowerShell/issues/26725#issuecomment-3818416164
Microsoft GitHub Policy Servicehttps://aka.ms/1es-gitops
microsoft-github-policy-servicehttps://github.com/apps/microsoft-github-policy-service
completedhttps://github.com/PowerShell/PowerShell/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Jan 29, 2026https://github.com/PowerShell/PowerShell/issues/26725#event-22380355475
https://github.com/AkitoTheGambler
Christian Gambale (AkitoTheGambler)https://github.com/AkitoTheGambler
on Sep 22, 2026https://github.com/PowerShell/PowerShell/issues/26725#issuecomment-5780158990
Michael Klement (@mklement0)https://github.com/mklement0
Patrick Meinecke (@SeeminglyScience)https://github.com/SeeminglyScience
Ryan Yates (@kilasuit)https://github.com/kilasuit
dotnet/runtime#132366 (comment)https://github.com/dotnet/runtime/issues/132366#issuecomment-5779300387
https://github.com/mklement0
Michael Klement (mklement0)https://github.com/mklement0
on Sep 22, 2026https://github.com/PowerShell/PowerShell/issues/26725#issuecomment-5784293334
Christian Gambale (@AkitoTheGambler)https://github.com/AkitoTheGambler
RFC for *-EnvironmentVariable cmdlets. PowerShell-RFC#92https://github.com/PowerShell/PowerShell-RFC/pull/92
RFC for *-EnvironmentVariable cmdlets. PowerShell-RFC#92 (comment)https://github.com/PowerShell/PowerShell-RFC/pull/92#issuecomment-429464051
https://github.com/AkitoTheGambler
Christian Gambale (AkitoTheGambler)https://github.com/AkitoTheGambler
on Oct 31, 2026https://github.com/PowerShell/PowerShell/issues/26725#issuecomment-6537691215
Michael Klement (@mklement0)https://github.com/mklement0
Sign up for freehttps://github.com/signup?return_to=https://github.com/PowerShell/PowerShell/issues/26725
Sign in to commenthttps://github.com/login?return_to=https://github.com/PowerShell/PowerShell/issues/26725
.NETPull requests that update .NET codehttps://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22.NET%22
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
Resolution-AnsweredThe question is answered.https://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22Resolution-Answered%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.