Skip to content

Bug - HOME env not set, error message is not clear on what the issue is #2299

@damon-atkins

Description

@damon-atkins

HOME environment varable not set results in a error message which is hard to determine the actual fault.

If calling powershell from another tool, HOME may not be part of the environment space. Powershell should report better error message.

Steps to reproduce

$ unset HOME
$ powershell
PowerShell
Copyright (C) 2016 Microsoft Corporation. All rights reserved.

The shell cannot be started. A failure occurred during initialization:
The type initializer for 'System.Management.Automation.ConfigPropertyAccessor' threw an exception.

Expected behavior

$ unset HOME
$ powershell
PowerShell
Copyright (C) 2016 Microsoft Corporation. All rights reserved.
Please set the HOME environment variable before using powershell, as powershell stores configuration items in $HOME/.configure/powershell

Actual behavior

PowerShell
Copyright (C) 2016 Microsoft Corporation. All rights reserved.

The shell cannot be started. A failure occurred during initialization:
The type initializer for 'System.Management.Automation.ConfigPropertyAccessor' threw an exception.

Environment data

powershell '$PSVersionTable'

Name                           Value
----                           -----
PSVersion                      6.0.0-alpha
PSEdition                      Core
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   3.0.0.0
GitCommitId                    v6.0.0-alpha.10
CLRVersion
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-BugIssue has been identified as a bug in the productResolution-DuplicateThe issue is a duplicate.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions