[SOLVED] Powershell's cmdlet "Get-Partition" started to give error message

etord72

Reputable
May 25, 2019
10
0
4,510
Hi,
for years I've been using the PowerShell's commands GET-PARTITION and SET-PARTITION to change drive letters using a macro, without any issue.Recently, PowerShell started giving the "INVALID PROPERTY" error message (see below).
I can't tell when this started to happen, but I recently ran some optimizers, like "Windows repair" by tweaking.com, which my have tampered with the system and the environment variables.
Can someone please hint me on a possible cause or where to start looking for it?
Please, note that I'd prefer to keep using this powershell command, so i.e. diskpart wouldn't be feasible alternative.
I'm using Windows 10 Pro, regularly updated.
Thanks!

PS C:\> Get-Partition
get-partition : Invalid property
At line:1 char:1
  • get-partition
  • ~~~~~~~~~~~~~
  • CategoryInfo : MetadataError: (MSFT_Partition:ROOT/Microsoft/.../MSFT_Partition) [Get-Partition], CimException
  • FullyQualifiedErrorId : HRESULT 0x80041031,Get-Partition
 
Solution
try this in cmd:
Code:
sc config winmgmt start= disabled
net stop winmgmt
Winmgmt /salvagerepository %windir%\System32\wbem
Winmgmt /resetrepository %windir%\
sc config winmgmt start= auto
D

Deleted member 14196

Guest
the optimizers probably hosed you for sure, do as suggested above. please don't ever run those garbageware utilities ever again in the future. they screw up machines all the time.
 
  • Like
Reactions: etord72

etord72

Reputable
May 25, 2019
10
0
4,510
try this in cmd:
Code:
sc config winmgmt start= disabled
net stop winmgmt
Winmgmt /salvagerepository %windir%\System32\wbem
Winmgmt /resetrepository %windir%\
sc config winmgmt start= auto

This solution perfectly restored the cmdlets, it absolutely solved the problem.
Congratulations and thanks a lot!
 
D

Deleted member 14196

Guest
right, usually they don't (laughing), but it did. garbage don't ever use them again and you won't have these issues. they do all manner of mischief behind your back

i would clean install windows myself to ensure all their garbage changes were gone.
 
right, usually they don't (laughing), but it did. garbage don't ever use them again and you won't have these issues. they do all manner of mischief behind your back

i would clean install windows myself to ensure all their garbage changes were gone.
i still doubt that, you can search google for wmi repository and 99% search reults would tell you that its not uncommon that it breaks on its own, tho there are other ways how to check which content is borked and slowly repair it, but code above is a 100% nuke xD like from fresh windows install
 
D

Deleted member 14196

Guest
I’ll take a snapshot of a virtual machine before hand and then afterwards and we’ll see exactly what it does. I have a scanning tool I can scan the entire system including the registry
 

TRENDING THREADS