Skip to content

[AllowEmptyString()] for -Description in Set-LocalGroup/Set-LocalUser #16049

Closed

Description

@iRon7

Prerequisites

Steps to reproduce

See: StackOverflow question: How to set the description of a local group to blank

The Set-LocalGroup/SetLocalUser cmdlet do not allow empty strings for the -Description parameter (which is set to [ValidateNotNull()]):

New-LocalGroup -Name 'Group1' -Description 'My description'

Name   Description
----   -----------
Group1 My description

Set-LocalGroup -Name 'Group1' -Description ''

Expected behavior

Description set to a zero length string:

Get-LocalGroup -Name 'Group1'

Name   Description
----   -----------
Group1

Actual behavior

Set-LocalGroup: Cannot bind argument to parameter 'Description' because it is an empty string.

Consequently it is not possible to clear the description with the concerned cmdlets.

Environment data

Name                           Value
----                           -----
PSVersion                      7.1.4
PSEdition                      Core
GitCommitId                    7.1.4
OS                             Microsoft Windows 10.0.19042
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Activity

  1. added
    Needs-Triage
    on Sep 4, 2021
  2. changed the title [-]`AllowEmptyString()]` for `-Description` in `Set-LocalGroup`/`SetLocalUser`[/-] [+]`[AllowEmptyString()]` for `-Description` in `Set-LocalGroup`/`SetLocalUser`[/+] on Sep 4, 2021
  3. iSazonov commented on Sep 4, 2021

    @iSazonov
    Collaborator

    The module is not in the repository. Please report the issue with Windows Feedback tool.

  4. added
    Resolution-External
    on Sep 4, 2021
  5. changed the title [-]`[AllowEmptyString()]` for `-Description` in `Set-LocalGroup`/`SetLocalUser`[/-] [+]`[AllowEmptyString()]` for `-Description` in `Set-LocalGroup`/`Set-LocalUser`[/+] on Sep 6, 2021
  6. iRon7 commented on Sep 6, 2021

    @iRon7
    Author

    The module is not in the repository. Please report the issue with Windows Feedback tool.

    Ilya (@iSazonov) , I am somewhat confused here:
    If I:

    Afaik, the related commands are here:
    PowerShell/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Commands/

    What do you mean with the Windows Feedback tool?

  7. iSazonov commented on Sep 6, 2021

    @iSazonov
    Collaborator

    The module is not compiled in the repository because of compliance issues. So it is only Windows PowerShell module.

    What do you mean with the Windows Feedback tool?

    On Windows press Start button and type Feedback

  8. iRon7 commented on Sep 6, 2021

    @iRon7
    Author

    I feel a little 😳 that I wasn't aware of the Windows Feedback tool.
    Anyways I have opened a case in there at referred to this issue.

  9. iSazonov commented on Jul 9, 2024

    @iSazonov
    Collaborator
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

    Needs-TriageResolution-External

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions