Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running New-LocalUser in PowerShell 7.3 raises an error #18624

Closed
5 tasks done
trainee4it opened this issue Nov 20, 2022 · 10 comments
Closed
5 tasks done

Running New-LocalUser in PowerShell 7.3 raises an error #18624

trainee4it opened this issue Nov 20, 2022 · 10 comments
Labels
Resolution-External The issue is caused by external component(s).

Comments

@trainee4it
Copy link

Prerequisites

Steps to reproduce

To reproduce :

Open PowerShell 7.3 X64 . (latest)

Run the New-LocalUser Cmdlet

Expected behavior

Creation of Local User

Actual behavior

We get this error and the user does not get created.

New-LocalUser: Could not load type 'Microsoft.PowerShell.Telemetry.Internal.TelemetryAPI' from assembly 'System.Management.Automation, Version=7.3.0.500, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.

Error details

Exception             :
    Type       : System.TypeLoadException
    Message    : Could not load type 'Microsoft.PowerShell.Telemetry.Internal.TelemetryAPI' from assembly 'System.Management.Automation, Version=7.3.0.500, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
    TypeName   : Microsoft.PowerShell.Telemetry.Internal.TelemetryAPI
    TargetSite :
        Name          : ProcessRecord
        DeclaringType : Microsoft.PowerShell.Commands.NewLocalUserCommand
        MemberType    : Method
        Module        : Microsoft.PowerShell.LocalAccounts.dll
    Source     : Microsoft.PowerShell.LocalAccounts
    HResult    : -2146233054
    StackTrace :
   at Microsoft.PowerShell.Commands.NewLocalUserCommand.ProcessRecord()
   at System.Management.Automation.CommandProcessor.ProcessRecord()
CategoryInfo          : NotSpecified: (:) [New-LocalUser], TypeLoadException
FullyQualifiedErrorId : System.TypeLoadException,Microsoft.PowerShell.Commands.NewLocalUserCommand
InvocationInfo        :
    MyCommand        : New-LocalUser
    ScriptLineNumber : 1
    OffsetInLine     : 1
    HistoryId        : 6
    Line             : new-LocalUser -Name login2
    PositionMessage  : At line:1 char:1
                       + new-LocalUser -Name login2
                       + ~~~~~~~~~~~~~~~~~~~~~~~~~~
    InvocationName   : new-LocalUser
    CommandOrigin    : Internal
ScriptStackTrace      : at <ScriptBlock>, <No file>: line 1

Environment data

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

Visuals

No response

@trainee4it trainee4it added the Needs-Triage The issue is new and needs to be triaged by a work group. label Nov 20, 2022
@SteveL-MSFT SteveL-MSFT added the Resolution-External The issue is caused by external component(s). label Nov 21, 2022
@SteveL-MSFT
Copy link
Member

This is a problem in Windows PowerShell and that team is aware of this already. For now, you'll have to use Windows PowerShell to use that cmdlet.

@SteveL-MSFT SteveL-MSFT removed the Needs-Triage The issue is new and needs to be triaged by a work group. label Nov 21, 2022
@ghost
Copy link

ghost commented Nov 22, 2022

This issue has been marked as external and has not had any activity for 1 day. It has been be closed for housekeeping purposes.

@ghost ghost closed this as completed Nov 22, 2022
@idontsov
Copy link

idontsov commented Jan 17, 2023

This is a problem in Windows PowerShell and that team is aware of this already.

@SteveL-MSFT, could you please provide a link to the bug in the "external component" so that we receive a notification when the issue is resolved?

@h4wtd0gz
Copy link

h4wtd0gz commented May 3, 2023

Link to the bug would be super useful, as we also notice the same issue on 7.3.4.

@pierrecorsini
Copy link

PowerShell 7.3.4 ; same issue for me.

@thuynhyubi
Copy link

Has there been any progress on this? Also running into the same error PS7.3.5 on W11.

@arkadR
Copy link

arkadR commented Jul 25, 2023

Is there any update on this? Still hitting the error on 7.4.0-preview.4 and Windows 11.

@thuynhyubi
Copy link

Is there any update on this? Still hitting the error on 7.4.0-preview.4 and Windows 11.

I found a workaround to this issue by using the below import.

import-module microsoft.powershell.localaccounts -UseWindowsPowerShell

@ethanf53
Copy link

Still seeing this issue on 7.4.1 on Windows 11.

@mrcellal
Copy link

I am seeing it as well. the workaround posted above does seem to allow it to function.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution-External The issue is caused by external component(s).
Projects
None yet
Development

No branches or pull requests

9 participants