Oct 18 2022 09:52 AM
I'm trying to use powershell 7 to create a new local user on my computer and I always get an error message.
PowerShell 7.2.6
Copyright (c) Microsoft Corporation.
https://aka.ms/powershell
Type 'help' to get help.
PS C:\Windows\System32> new-localuser -name 'bob'
cmdlet New-LocalUser at command pipeline position 1
Supply values for the following parameters:
Password:
New-LocalUser: Could not load type 'Microsoft.PowerShell.Telemetry.Internal.TelemetryAPI' from assembly 'System.Management.Automation, Version=7.2.6.500, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
PS C:\Windows\System32>
Oct 24 2022 07:16 AM
SolutionNov 14 2022 01:29 PM - edited Nov 29 2022 05:05 AM
Any update? Did this work out for you ?
Aug 04 2023 11:57 AM
Aug 04 2023 12:00 PM
@santiago_-_-
"it does work after running import-module microsoft.powershell.localaccounts -UseWindowsPowerShell (Effectively running it in PowerShell v5 mode in PowerShell v7)"
Just tested it again, still works like that in PowerShell 7
Aug 04 2023 08:02 PM
Hello and thank you for getting back to me so quickly! You are right it does work (second picture), however, I get this message after I run the cmdlets (first picture top). The problem is that after I close the Powershell terminal I get the same error (third picture), does that mean that I have to run the cmdlet import-module microsoft.powershell.localaccounts -usewindowspowershell every single time I open Powershell and want to create a new local user?
Aug 05 2023 02:09 AM
Apr 17 2024 11:59 PM
@Harm_VeenstraThank you so much i had this issue and your import function fixed it for me.
Huge help.
Oct 24 2022 07:16 AM
Solution