Skip to content

PowerShell can now set environment variables to the empty string #12313

@zakw

Description

@zakw

Type of issue

Outdated article

Feedback

In the PowerShell 7.5 documentation on manipulating Environment Variables, it suggests that you can clear an environment variable by setting it to an empty string or $null in at least these sections:

As noted in PowerShell/PowerShell#21186 (comment), PowerShell 7.5 introduced the ability to set environment variables to an empty string instead of unsetting the variable.

It would be wonderful if the documentation could reflect this new enhancement!

Page URL

https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_environment_variables?view=powershell-7.5

Content source URL

https://github.com/MicrosoftDocs/PowerShell-Docs/blob/main/reference/7.5/Microsoft.PowerShell.Core/About/about_Environment_Variables.md

Author

@sdwheeler

Platform Id

a3aeb832-03f5-06f5-5d5e-5a0a9f660dcb

Document Id

dfc13aff-02f5-c1ea-d736-68a55241ab52

Metadata

Metadata

Assignees

Labels

area-aboutArea - About_ topics

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions