The mystery of format-volume

Welcome Forums General PowerShell Q&A The mystery of format-volume

This topic contains 3 replies, has 3 voices, and was last updated by

 
Participant
1 year, 6 months ago.

  • Author
    Posts
  • #70152

    Participant
    Points: 1
    Rank: Member

    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

    Keymaster
    Points: 1,644
    Helping HandTeam Member
    Rank: Community Hero

    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

    Participant
    Points: 0
    Rank: Member

    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

    Participant
    Points: 1
    Rank: Member

    Thanks so much. Now it all makes sense!

The topic ‘The mystery of format-volume’ is closed to new replies.