I am working on a brand-new Windows 10 (Pro) (build 1809) install. I tried to use some basic scripts, and discovered (via testing and experimentation) that the manifest module Microsoft.PowerShell.LocalAccount is missing from this install
$PSVersionTable.PSversion
Major Minor Build Revision
5 1 17763 316
Interestingly, I couldn’t find Microsoft.PowerShell.LocalAccounts in the “official” repo (https://www.powershellgallery.com). I did find the module “localuser” which SEEMS to be correct. So… I tried to install the module
install-module -name LocalAccount
resulted in errors. So I tried
install-module -name LocalAccount -AllowClobber
…and then
Import-Module -name LocalAccount
<p class=“s14dydj4-10 kiAEUp”>Success…sort of. Get-Module -ListAvailable shows LocalAccount listed as ModuleType: Script (version 1.6), but it specifically is NOT listed under the ModuleType: Manfest list. And… Get-LocalUSer now works, but doesn’t have the same options as I’m used to (specifically, I can’t enumerate the fields “Enabled” or “SID,” both of which I need for the job I’m doing).</p>
<p class=“s14dydj4-10 kiAEUp”>Oh, and running “Get-Module -ListAvailable” on my other computers returns “ModuleType Manfest” “Name: Microsoft.PowerShell.LocalAccounts”. Here’s a shot of one of my systems where it’s installed “properly:”</p>
PS C:\WINDOWS\system32> Get-Module -ListAvailable -Name Microsoft.Powershell.LocalAccounts
Directory: C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules
ModuleType Version Name ExportedCommands
---------- ------- ---- ----------------
Manifest 1.0.0.0 Microsoft.PowerShell.LocalAccounts {Add-LocalGroupMember, Disable-LocalUser, Enable-LocalUser...
PS C:\WINDOWS\system32> $PSVersionTable.PSVersion
Major Minor Build Revision
----- ----- ----- --------
5 1 17134 590
Does anyone have ANY ideas? Obviously, the build and version numbers are different, but I don’t know how to revert the new installation to an older build. I did a bunch of searching (on reverting the build, reinstalling Windows management Framework 5.1, and the missing module error/issue specifically) but didn’t find anything helpful. And the kicker - The Windows 10 Pro install was installed from the same installation media from which my other (properly working) systems were installed.
I tried this; I’m still experiencing the same issue. Specifically, I’m seeing different attributes than I expect to see (and that I see on other systems with the same OS version but, as noted in the original posted, apparently a different PSH version). Examples:
<p class=“s14dydj4-10 kiAEUp”>From known-good (“working”) PSH instance, Windows 10 Pro (1803)</p>
Ok. I have done some testing to find out what is happening. It looks the the command you ran above is still using the module installed from the PowerShell Gallery. I have replicated your result from the previous post.