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

etord72

Commendable
May 25, 2019
6
0
1,510
0
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
 

etord72

Commendable
May 25, 2019
6
0
1,510
0
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!
 
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
 

ASK THE COMMUNITY