Get-WmiObject inconsisten or NULL values returned

Welcome Forums General PowerShell Q&A Get-WmiObject inconsisten or NULL values returned

This topic contains 1 reply, has 2 voices, and was last updated by

1 year, 1 month ago.

  • Author
  • #97185

    Topics: 1
    Replies: 0
    Points: 1
    Rank: Member


    I have the following Powershell line to get information about the progress of HyperV merge and replication sync status on a Windows Server 2016 installation :
    Get-WmiObject -Namespace "root\virtualization\v2" -Query "select * from Msvm_ConcreteJob" | select name,PercentComplete

    My issue is it often returns a blank line when it should return a value as I know its doing something. So for instance if HyperV is doing a replication resync I run the command and it shows me the percentage complete:
    name PercentComplete
    —- —————
    Resynchronizing 46

    If I run it again it often returns a blank line, if I leave it a minute or so then run it again I get a result but often with more information:

    name PercentComplete
    —- —————
    Modifying Resource 100
    Applying Replica Changes 50
    Apply Registered Delta 0
    Merge in Progress 100
    Applying Replica Changes 0
    Receiving changes 100
    Resynchronizing 46
    Receiving changes 100

    Why is it inconsistent when returning values partuclarly the Resyncronization value that should return a value until its compelte?



  • #97211

    Topics: 13
    Replies: 4872
    Points: 1,811
    Helping HandTeam Member
    Rank: Community Hero

    WMI/CIM consists of a bazillion little underlying "providers." Those providers are responsible for sticking data into the repository and responding to queries; in this case, the provider appears to be Not Well Written. It's likely related to Hyper-V's management architecture, but there's not much you can do in terms of gaining insight or fixing it.

    But it's not PowerShell's fault, if that helps 😉

The topic ‘Get-WmiObject inconsisten or NULL values returned’ is closed to new replies.

denizli escort samsun escort muğla escort ataşehir escort kuşadası escort