Skip to content

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

Closed

Description

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

Activity

  1. andyleejordan commented on Sep 19, 2016

    @andyleejordan
    Member

    Same problem as #2205.

    Mike Richmond (@mirichmo) this is due to the ConfigPropertyAccessor requiring that HOME be both set and writable, but that's something that can be expected.

  2. andyleejordan commented on Sep 19, 2016

    @andyleejordan
    Member

    I'm going to close as duplicate; but thank you for filing. This is indeed a bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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