The mystery of format-volume

This topic contains 3 replies, has 3 voices, and was last updated by  Eric Morin 5 months, 2 weeks ago.

  • Author
    Posts
  • #70152

    Eric Morin
    Participant

    Hi all –

    I've searched the Google and not been able to find a definite statement, but it seems that Format-Volume is not available in PowerShell on Windows 7. See below for the output of my psversiontable. From what I can tell, I should be able to use Format-Volume in PS4, and yet I can't. Any help is deeply appreciated.

    \/redacted\/> $psversiontable

    Name Value
    —- —–
    PSVersion 4.0
    WSManStackVersion 3.0
    SerializationVersion 1.1.0.1
    CLRVersion 4.0.30319.42000
    BuildVersion 6.3.9600.16406
    PSCompatibleVersions {1.0, 2.0, 3.0, 4.0}
    PSRemotingProtocolVersion 2.2

  • #70155

    Don Jones
    Keymaster

    That's not tied to a version of PowerShell; it's tied to the version of Windows. According to https://technet.microsoft.com/library/hh848665(v=wps.630).aspx, it was introduced in Win8.

  • #70165

    Richard Siddaway
    Moderator

    Format-Volume is part of the Storage module introduced, as Don stated, with Windows 8. The storage module is a CDXML module – take a CIM (WMI) class, wrap it in XML and publish as a module – see PowerShell and WMI (https://www.manning.com/books/powershell-and-wmi) for full details.

    The CIM classes on which the Storage module is based were introduced with Windows 8. There has been no, and its very unlikely there ever will be an, effort to make those CIM classes available for pre-Windows 8 versions of Windows.

    For Windows 7 and earlier use the Format method on the Win32_Volume class to achieve the same effect.

  • #70233

    Eric Morin
    Participant

    Thanks so much. Now it all makes sense!

You must be logged in to reply to this topic.