             5 { $_status += "Predictive Failure" }
              6 { $_status += "Error" }
              7 { $_status += "Non-Recoverable Error" }
              8 { $_status += "Starting" }
              9 { $_status += "Stopping" }
              10 { $_status += "Stopped" }
              11 { $_status += "InService" }
              12 { $_status += "No Contact" }
              13 { $_status += "Lost Communication" }
              14 { $_status += "Aborted" }
              15 { $_status += "Dormant" }
              16 { $_status += "Supporting Entity in Error" }
              17 { $_status += "Completed" }
              18 { $_status += "Power Mode" }
              19 { $_status += "Relocating" }
              Default { $_status += "Unknown" }
            }
          }
          $_status;
        </GetScriptBlock>
      </ScriptProperty>
      <ScriptProperty>
        <Name>HealthStatus</Name>
        <GetScriptBlock>
          switch ($this.psBase.CimInstanceProperties["HealthStatus"].Value)
          {
            0 { "Healthy" }
            1 { "Warning" }
            2 { "Unhealthy" }
            Default { "Unknown" }
          }
        </GetScriptBlock>
      </ScriptProperty>
      <ScriptProperty>
        <Name>LinkTechnology</Name>
        <GetScriptBlock>
          if ( $this.psBase.CimInstanceProperties["LinkTechnology"].Flags.HasFlag([Microsoft.Management.Infrastructure.CimFlags]::NullValue) -eq $false )
          {
            switch ($this.psBase.CimInstanceProperties["LinkTechnology"].Value)
            {
              0 { "Unknown" }
              1 { "Other" }
              2 { "Ethernet" }
              3 { "IB" }
              4 { "FC" }
              5 { "FDDI" }
              6 { "ATM" }
              7 { "Token Ring" }
              8 { "Frame Relay" }
              9 { "Infrared" }
              10 { "Bluetooth" }
              11 { "Wireless LAN" }
              Default { "Unknown" }
            }
          }
          else
          {
            $null
          }
        </GetScriptBlock>
      </ScriptProperty>
      <ScriptProperty>
        <Name>PortType</Name>
        <GetScriptBlock>
          if ( $this.psBase.CimInstanceProperties["PortType"].Flags.HasFlag([Microsoft.Management.Infrastructure.CimFlags]::NullValue) -eq $false )
          {
            switch ($this.psBase.CimInstanceProperties["PortType"].Value)
            {
              0 { "Unknown" }
              1 { "Other" }
              10 { "N" }
              11 { "NL" }
              12 { "F/NL" }
              13 { "Nx" }
              14 { "E" }
              15 { "F" }
              16 { "FL" }
              17 { "B" }
              18 { "G" }
              50 {"10BaseT" }
              51 { "10-100BaseT" }
              52 { "100BaseT" }
              53 { "1000BaseT" }
              54 { "2500BaseT" }
              55 { "10GBaseT" }
              56 { "10GBase-CX4" }
              94 { "SAS" }
              100 { "100Base-FX" }
              101 { "100Base-SX" }
              102 { "1000Base-SX" }
              103 { "1000Base-LX" }
              104 { "1000Base-CX" }
              105 { "10GBase-SR" }
              106 { "10GBase-SW" }
              107 { "10GBase-LX4" }
              108 { "10GBase-LR" }
              109 { "10GBase-LW" }
              110 { "10GBase-ER" }
              111 { "10GBase-EW" }
              Default { "Unknown" }
            }
          }
          else
          {
            $null
          }
        </GetScriptBlock>
      </ScriptProperty>
      <ScriptProperty>
        <Name>UsageRestriction</Name>
        <GetScriptBlock>
          if ( $this.psBase.CimInstanceProperties["UsageRestriction"].Flags.HasFlag([Microsoft.Management.Infrastructure.CimFlags]::NullValue) -eq $false )
          {
            switch ($this.psBase.CimInstanceProperties["UsageRestriction"].Value)
            {
              0 { "Unknown" }
              2 { "Front-end only" }
              3 { "Back-end only" }
              4 { "Not restricted" }
              Default { "Unknown" }
            }
          }
          else
          {
            $null
          }
        </GetScriptBlock>
      </ScriptProperty>
    </Members>
  </Type>
  <!--

  //
  // InitiatorId
  //

  -->
  <Type>
    <Name>Microsoft.Management.Infrastructure.CimInstance#MSFT_InitiatorId</Name>
    <Members>
      <ScriptProperty>
        <Name>Type</Name>
        <GetScriptBlock>
          if ( $this.psBase.CimInstanceProperties["Type"].Flags.HasFlag([Microsoft.Management.Infrastructure.CimFlags]::NullValue) -eq $false )
          {
            switch ($this.psBase.CimInstanceProperties["Type"].Value)
            {
              1 { "Other" }
              2 { "PortWWN" }
              3 { "NodeWWN" }
              4 { "Hostname" }
              5 { "iSCSI Name" }
              6 { "SwitchWWN" }
              7 { "SASAddress" }
              Default { "Unknown" }
            }
          }
          else
          {
            $null
          }
        </GetScriptBlock>
      </ScriptProperty>
      <ScriptProperty>
        <Name>HostType</Name>
        <GetScriptBlock>
          if ( $this.psBase.CimInstanceProperties["HostType"].Flags.HasFlag([Microsoft.Management.Infrastructure.CimFlags]::NullValue) -eq $false )
          {
            switch ($this.psBase.CimInstanceProperties["HostType"].Value)
            {
              0 { "Unknown" }
              1 { "Other" }
              2 { "Standard" }
              3 { "Solaris" }
              4 { "HPUX" }
              5 { "OpenVMS" }
              6 { "Tru64" }
              7 { "Netware" }
              8 { "Sequent" }
              9 { "AIX" }
              10 { "DGUX" }
              11 { "Dynix" }
              12 { "Irix" }
              13 { "Cisco iSCSI Storage Router" }
              14 { "Linux" }
              15 { "Microsoft Windows" }
              16 { "OS400" }
              17 { "TRESPASS" }
              18 { "HI-UX" }
              19 { "VMware ESXi" }
              20 { "Microsoft Windows Server 2008" }
              21 { "Microsoft Windows Server 2003" }
              Default { "Unknown" }
            }
          }
          else
          {
            $null;
          }
        </GetScriptBlock>
      </ScriptProperty>
    </Members>
  </Type>
  <!--

  //
  // InitiatorPort
  //

  -->
  <Type>
    <Name>Microsoft.Management.Infrastructure.CimInstance#MSFT_InitiatorPort</Name>
    <Members>
      <ScriptProperty>
        <Name>PortType</Name>
        <GetScriptBlock>
          switch ($this.psBase.CimInstanceProperties["PortType"].Value)
          {
            1 { "Unknown" }
            2 { "Other" }
            3 { "Not present" }
            5 { "Fabric" }
            6 { "Public Loop" }
            7 { "FL Port" }
            8 { "Fabric Port" }
            9 { "Fabric expansion port" }
            10 { "Generic Fabric Port" }
            20 { "Private Loop" }
            21 { "Point to Point" }
            Default { "Unknown" }
          }
        </GetScriptBlock>
      </ScriptProperty>
      <ScriptProperty>
        <Name>ConnectionType</Name>
        <GetScriptBlock>
          switch ($this.psBase.CimInstanceProperties["ConnectionType"].Value)
          {
            0 { "Other" }
            1 { "Fibre Channel" }
            2 { "iSCSI" }
            3 { "SAS" }
            Default { "Unknown" }
          }
        </GetScriptBlock>
      </ScriptProperty>
      <ScriptProperty>
        <Name>OperationalStatus</Name>
        <GetScriptBlock>
          $_status = @();
          foreach ( $status in $this.psBase.CimInstanceProperties["OperationalStatus"].Value )
          {
            switch ( $status )
            {
              1 { $_status += "Unknown" }
              2 { $_status += "Operational" }
              3 { $_status += "User Offline" }
              4 { $_status += "Bypassed" }
              5 { $_status += "In diagnostics mode" }
              6 { $_status += "Link Down" }
              7 { $_status += "Port Error" }
              8 { $_status += "Loopback" }
            }
          }
          $_status;
        </GetScriptBlock>
      </ScriptProperty>
      <ScriptProperty>
        <Name>PortSupportedSpeed</Name>
        <GetScriptBlock>
          switch ($this.psBase.CimInstanceProperties["PortSupportedSpeed"].Value)
          {
            1 { "1 GBit/sec" }
            2 { "2 GBit/sec" }
            4 { "10 GBit/sec" }
            8 { "4 GBit/sec" }
            Default { "Unknown" }
          }
        </GetScriptBlock>
      </ScriptProperty>
      <ScriptProperty>
        <Name>PortSpeed</Name>
        <GetScriptBlock>
          switch ($this.psBase.CimInstanceProperties["PortSpeed"].Value)
          {
            1 { "1 GBit/sec" }
            2 { "2 GBit/sec" }
            4 { "10 GBit/sec" }
            8 { "4 GBit/sec" }
            Default { "Unknown" }
          }
        </GetScriptBlock>
      </ScriptProperty>
    </Members>
  </Type>
  <!--

  //
  // MaskingSet
  //

  -->
  <Type>
    <Name>Microsoft.Management.Infrastructure.CimInstance#MSFT_MaskingSet</Name>
    <Members>
      <ScriptProperty>
        <Name>HostType</Name>
        <GetScriptBlock>
          if ( $this.psBase.CimInstanceProperties["HostType"].Flags.HasFlag([Microsoft.Management.Infrastructure.CimFlags]::NullValue) -eq $false )
          {
            switch ($this.psBase.CimInstanceProperties["HostType"].Value)
            {
              0 { "Unknown" }
              1 { "Other" }
              2 { "Standard" }
              3 { "Solaris" }
              4 { "HPUX" }
              5 { "OpenVMS" }
              6 { "Tru64" }
              7 { "Netware" }
              8 { "Sequent" }
              9 { "AIX" }
              10 { "DGUX" }
              11 { "Dynix" }
              12 { "Irix" }
              13 { "Cisco iSCSI Storage Router" }
              14 { "Linux" }
              15 { "Microsoft Windows" }
              16 { "OS400" }
              17 { "TRESPASS" }
              18 { "HI-UX" }
              19 { "VMware ESXi" }
              20 { "Microsoft Windows Server 2008" }
              21 { "Microsoft Windows Server 2003" }
              Default { "Unknown" }
            }
          }
          else
          {
            $null
          }
        </GetScriptBlock>
      </ScriptProperty>
    </Members>
  </Type>
<!--

//
// StorageSetting
//

-->
  <Type>
    <Name>Microsoft.Management.Infrastructure.CimInstance#MSFT_StorageSetting</Name>
    <Members>
        <ScriptProperty>
            <Name>NewDiskPolicy</Name>
            <GetScriptBlock>
                switch ($this.psBase.CimInstanceProperties["NewDiskPolicy"].Value)
                {
                0 { "Unknown" }
                1 { "OnlineAll" }
                2 { "OfflineShared" }
                3 { "OfflineAll" }
                4 { "OfflineInternal" }
                Default { "OfflineShared" }
                }
            </GetScriptBlock>
        </ScriptProperty>
        <ScriptProperty>
            <Name>ScrubPolicy</Name>
            <GetScriptBlock>
                switch ($this.psBase.CimInstanceProperties["ScrubPolicy"].Value)
                {
                0 { "Off" }
                1 { "IntegrityStreams" }
                2 { "All" }
                Default { "Integrity Streams" }
                }
            </GetScriptBlock>
        </ScriptProperty>
    </Members>
  </Type>
  <!--

  //
  // StorageJob
  //

  -->
  <Type>
    <Name>Microsoft.Management.Infrastructure.CimInstance#MSFT_StorageJob</Name>
    <Members>
      <ScriptProperty>
        <Name>OperationalStatus</Name>
        <GetScriptBlock>
          $_status = @();
          foreach ( $status in $this.psBase.CimInstanceProperties["OperationalStatus"].Value )
          {
            switch ( $status )
            {
              1 { $_status += "Other" }
              2 { $_status += "OK" }
              3 { $_status += "Degraded" }
              4 { $_status += "Stressed" }
              5 { $_status += "Predictive Failure" }
              6 { $_status += "Error" }
              7 { $_status += "Non-Recoverable Error" }
              8 { $_status += "Starting" }
              9 { $_status += "Stopping" }
              10 { $_status += "Stopped" }
              11 { $_status += "In Service" }
              12 { $_status += "No Contact" }
              13 { $_status += "Lost Communication" }
              14 { $_status += "Aborted" }
              15 { $_status += "Dormant" }
              16 { $_status += "Supporting Entity in Error" }
              17 { $_status += "Completed" }
              18 { $_status += "Power Mode" }
              19 { $_status += "Relocating" }
              32772 { $_status += "Failed Media" }
              32773 { $_status += "Split" }
              32774 { $_status += "Stale Metadata" }
              32775 { $_status += "IO Error" }
              32776 { $_status += "Unrecognized Metadata" }
              Default { "Unknown" }
            }
          }
          $_status;
        </GetScriptBlock>
      </ScriptProperty>
      <ScriptProperty>
        <Name>JobState</Name>
        <GetScriptBlock>
          switch ( $this.psBase.CimInstanceProperties["JobState"].Value )
          {
            2 { "New" }
            3 { "Starting" }
            4 { "Running" }
            5 { "Suspended" }
            6 { "Shutting Down" }
            7 { "Completed" }
            8 { "Terminated" }
            9 { "Killed" }
            10 { "Exception" }
            11 { "Service" }
            12 { "Query Pending" }
            Default { "Unknown" }
          }
        </GetScriptBlock>
      </ScriptProperty>
    </Members>
  </Type>
  <!--

  //
  // FileStorageTier
  //

  -->
  <Type>
    <Name>Microsoft.Management.Infrastructure.CimInstance#MSFT_FileStorageTier</Name>
    <Members>
      <ScriptProperty>
        <Name>PlacementStatus</Name>
        <GetScriptBlock>
            switch ( $this.psBase.CimInstanceProperties["PlacementStatus"].Value )
            {
              0 { "Unknown" }
              1 { "Completely on tier" }
              2 { "Partially on tier" }
              3 { "Not on tier" }
              Default { "Unknown" }
            }
        </GetScriptBlock>
      </ScriptProperty>
      <ScriptProperty>
          <Name>State</Name>
          <GetScriptBlock>
            switch ( $this.psBase.CimInstanceProperties["State"].Value )
            {
              0 { "Unknown" }
              1 { "OK" }
              2 { "Insufficent Capacity" }
              3 { "In Process" }
              4 { "Pending" }
              Default { "Unknown" }
            }
          </GetScriptBlock>
      </ScriptProperty>
      <ScriptProperty>
        <Name>DesiredStorageTierClass</Name>
        <GetScriptBlock>
          switch ( $this.psBase.CimInstanceProperties["DesiredStorageTierClass"].Value )
          {
            1 { "Capacity" }
            2 { "Performance" }
            Default { "Unknown" }
          }
        </GetScriptBlock>
      </ScriptProperty>
    </Members>
  </Type>
  <!--

  //
  // StorageTier
  //

  -->
  <Type>
    <Name>Microsoft.Management.Infrastructure.CimInstance#MSFT_StorageTier</Name>
    <Members>
      <ScriptProperty>
        <Name>Usage</Name>
        <GetScriptBlock>
          switch ( $this.psBase.CimInstanceProperties["Usage"].Value )
          {
            0 { "Unknown" }
            1 { "Data" }
            2 { "Read Cache" }
            3 { "Write Cache" }
            4 { "Dirty Region Tracking" }
            5 { "Valid Data Tracking" }
            Default { "Unknown" }
          }
        </GetScriptBlock>
      </ScriptProperty>
      <ScriptProperty>
        <Name>ProvisioningType</Name>
        <GetScriptBlock>
          switch ( $this.psBase.CimInstanceProperties["ProvisioningType"].Value )
          {
            0 { "Unknown" }
            1 { "Thin" }
            2 { "Fixed" }
            Default { "Unknown" }
          }
        </GetScriptBlock>
      </ScriptProperty>
      <ScriptProperty>
        <Name>AllocationUnitSize</Name>
        <GetScriptBlock>
          if ( $this.psBase.CimInstanceProperties["AllocationUnitSize"].Value -eq [System.UInt64]::MaxValue )
          {
            "Auto"
          }
          else
          {
            $this.psBase.CimInstanceProperties["AllocationUnitSize"].Value
          }
        </GetScriptBlock>
      </ScriptProperty>
      <ScriptProperty>
        <Name>MediaType</Name>
        <GetScriptBlock>
          switch ( $this.psBase.CimInstanceProperties["MediaType"].Value )
          {
            0 { "Unspecified" }
            3 { "HDD" }
            4 { "SSD" }
            5 { "SCM" }
            Default { "Unspecified" }
          }
        </GetScriptBlock>
      </ScriptProperty>
      <ScriptProperty>
        <Name>TierClass</Name>
        <GetScriptBlock>
          switch ( $this.psBase.CimInstanceProperties["TierClass"].Value )
          {
            0 { "Unknown" }
            1 { "Capacity" }
            2 { "Performance" }
            Default { "Unknown" }
          }
        </GetScriptBlock>
      </ScriptProperty>
      <ScriptProperty>
        <Name>FaultDomainAwareness</Name>
        <GetScriptBlock>
          switch ($this.psBase.CimInstanceProperties["FaultDomainAwareness"].Value)
          {
            1 { "PhysicalDisk" }
            2 { "StorageEnclosure" }
            3 { "StorageScaleUnit" }
            4 { "StorageChassis" }
            5 { "StorageRack" }
            Default { "Unknown" }
          }
        </GetScriptBlock>
      </ScriptProperty>
      <ScriptProperty>
        <Name>ColumnIsolation</Name>
        <GetScriptBlock>
          switch ($this.psBase.CimInstanceProperties["ColumnIsolation"].Value)
          {
            1 { "PhysicalDisk" }
            2 { "StorageEnclosure" }
            3 { "StorageScaleUnit" }
            4 { "StorageChassis" }
            5 { "StorageRack" }
            Default { "Unknown" }
          }
        </GetScriptBlock>
      </ScriptProperty>
      <ScriptProperty>
        <Name>NumberOfColumns</Name>
        <GetScriptBlock>
          if ( $this.psBase.CimInstanceProperties["NumberOfColumns"].Value -eq [System.UInt16]::MaxValue )
          {
            "Auto"
          }
          else
          {
            $this.psBase.CimInstanceProperties["NumberOfColumns"].Value
          }
        </GetScriptBlock>
      </ScriptProperty>
      <ScriptProperty>
        <Name>NumberOfGroups</Name>
        <GetScriptBlock>
          if ( $this.psBase.CimInstanceProperties["NumberOfGroups"].Value -eq [System.UInt16]::MaxValue )
          {
            "Auto"
          }
          else
          {
            $this.psBase.CimInstanceProperties["NumberOfGroups"].Value
          }
        </GetScriptBlock>
      </ScriptProperty>
      <ScriptProperty>
        <Name>ParityLayout</Name>
        <GetScriptBlock>
          if ( $this.psBase.CimInstanceProperties["ParityLayout"].Flags.HasFlag([Microsoft.Management.Infrastructure.CimFlags]::NullValue) -eq $false )
          {
            switch ($this.psBase.CimInstanceProperties["ParityLayout"].Value)
            {
              1 { "Non-rotated Parity" }
              2 { "Rotated Parity" }
              Default { "Unknown" }
            }
          }
          else
          {
            $null
          }
        </GetScriptBlock>
      </ScriptProperty>
    </Members>
  </Type>
  <!--

  //
  // PhysicalExtent
  //

  -->
  <Type>
    <Name>Microsoft.Management.Infrastructure.CimInstance#MSFT_PhysicalExtent</Name>
    <Members>
      <ScriptProperty>
        <Name>Flags</Name>
        <GetScriptBlock>
          $_flags = $this.psBase.CimInstanceProperties["Flags"].Value
          $_flagsToHex = "{0:x16}" -f $_flags
          '0x' + $_flagsToHex;
        </GetScriptBlock>
      </ScriptProperty>
      <ScriptProperty>
        <Name>OperationalStatus</Name>
        <GetScriptBlock>
          $_status = @();
          foreach ( $status in $this.psBase.CimInstanceProperties["OperationalStatus"].Value )
          {
            switch ( $status )
            {
              13      { $_status += "Lost Communication" }
              53254   { $_status += "Stale Metadata" }
              53278   { $_status += "Active" }
              53279   { $_status += "Need Reallocation" }
              53280   { $_status += "Need Regeneration" }
              53281   { $_status += "Regenerating" }
              53282   { $_status += "Not Allocated" }
              53283   { $_status += "Pending Deletion" }
              Default { "Unknown" }
            }
          }
          $_status;
        </GetScriptBlock>
      </ScriptProperty>
    </Members>
  </Type>
  <!--

  //
  // StorageNodeToDisk
  //

  -->
  <Type>
      <Name>Microsoft.Management.Infrastructure.CimInstance#MSFT_StorageNodeToDisk</Name>
      <Members>
          <ScriptProperty>
              <Name>HealthStatus</Name>
              <GetScriptBlock>
                  switch ($this.psBase.CimInstanceProperties["HealthStatus"].Value)
                  {
                  0 { "Healthy" }
                  1 { "Warning" }
                  2 { "Unhealthy" }
                  Default { "Unknown" }
                  }
              </GetScriptBlock>
          </ScriptProperty>
          <ScriptProperty>
              <Name>OperationalStatus</Name>
              <GetScriptBlock>
                  $_status = @();
                  foreach( $status in $this.psBase.CimInstanceProperties["OperationalStatus"].Value )
                  {
                    switch ( $status )
                    {
                    1 { $_status += "Other" }
                    2 { $_status += "OK" }
                    3 { $_status += "Degraded" }
                    4 { $_status += "Stressed" }
                    5 { $_status += "Predictive Failure" }
                    6 { $_status += "Error" }
                    7 { $_status += "Non-Recoverable Error" }
                    8 { $_status += "Starting" }
                    9 { $_status += "Stopping" }
                   10 { $_status += "Stopped" }
                   11 { $_status += "InService" }
                   12 { $_status += "No Contact" }
                   13 { $_status += "Lost Communication" }
                   14 { $_status += "Aborted" }
                   15 { $_status += "Dormant" }
                   16 { $_status += "Supporting Entity in Error" }
                   17 { $_status += "Completed" }
                   18 { $_status += "Power Mode" }
                   19 { $_status += "Relocating" }
                   53264 { $_status += "Online" }
                   53265 { $_status += "Not Ready" }
                   53266 { $_status += "No Media" }
                   53267 { $_status += "Offline" }
                   53268 { $_status += "Failed" }
                   Default { $_status += "Unknown" }
                   }
                  }
                  $_status;
              </GetScriptBlock>
          </ScriptProperty>
          <ScriptProperty>
              <Name>OfflineReason</Name>
              <GetScriptBlock>
                  switch ($this.psBase.CimInstanceProperties["OfflineReason"].Value)
                  {
                  1 { "Policy" }
                  2 { "Redundant Path" }
                  3 { "Snapshot" }
                  4 { "Collision" }
                  5 { "Resource Exhaustion" }
                  6 { "Critical Write Failures" }
                  7 { "Data Integrity Scan Required" }
                  Default { $null }
                  }
              </GetScriptBlock>
          </ScriptProperty>
          <ScriptProperty>
              <Name>StorageNodeObjectId</Name>
              <GetScriptBlock>
                  $this.psBase.CimInstanceProperties["StorageNode"].Value.ObjectId
              </GetScriptBlock>
          </ScriptProperty>
          <ScriptProperty>
              <Name>DiskObjectId</Name>
              <GetScriptBlock>
                  $this.psBase.CimInstanceProperties["Disk"].Value.ObjectId
              </GetScriptBlock>
          </ScriptProperty>
      </Members>
  </Type>
  <!--

  //
  // FileServer
  //

  -->
  <Type>
      <Name>Microsoft.Management.Infrastructure.CimInstance#MSFT_FileServer</Name>
      <Members>
          <ScriptProperty>
              <Name>HealthStatus</Name>
              <GetScriptBlock>
                switch ( $this.psBase.CimInstanceProperties["HealthStatus"].Value )
                {
                0 { "Healthy" }
                1 { "Warning" }
                2 { "Unhealthy" }
                5 { "Unknown" }
                Default { "Unknown" }
                }
              </GetScriptBlock>
          </ScriptProperty>
          <ScriptProperty>
            <Name>OperationalStatus</Name>
            <GetScriptBlock>
              $_status = @();
              foreach ( $status in $this.psBase.CimInstanceProperties["OperationalStatus"].Value )
              {
                switch ( $status )
                {
                  1 { $_status += "Other" }
                  2 { $_status += "OK" }
                  3 { $_status += "Degraded" }
                  4 { $_status += "Stressed" }
                  5 { $_status += "Predictive Failure" }
                  6 { $_status += "Error" }
                  7 { $_status += "Non-Recoverable Error" }
                  8 { $_status += "Starting" }
                  9 { $_status += "Stopping" }
                  10 { $_status += "Stopped" }
                  11 { $_status += "In Service" }
                  12 { $_status += "No Contact" }
                  13 { $_status += "Lost Communication" }
                  14 { $_status += "Aborted" }
                  15 { $_status += "Dormant" }
                  16 { $_status += "Supporting Entity in Error" }
                  17 { $_status += "Completed" }
                  18 { $_status += "Power Mode" }
                  19 { $_status += "Relocating" }
                  53248 { $_status += "Read-Only" }
                  53248 { $_status += "Incomplete" }
                  Default { "Unknown" }
                }
              }
              $_status;
            </GetScriptBlock>
          </ScriptProperty>
          <ScriptProperty>
            <Name>FileSharingProtocols</Name>
            <GetScriptBlock>
                $_protos = @();
                foreach ( $p in $this.psBase.CimInstanceProperties["FileSharingProtocols"].Value )
                {
                  switch ( $p )
                  {
                    2 { $_protos += "NFS" }
                    3 { $_protos += "SMB" }
                    Default { "Unknown" }
                  }
                }
                $_protos;
            </GetScriptBlock>
          </ScriptProperty>
      </Members>
  </Type>
  <Type>
    <Name>Microsoft.Management.Infrastructure.CimInstance#MSFT_FileShare</Name>
    <Members>
      <ScriptProperty>
        <Name>HealthStatus</Name>
        <GetScriptBlock>
          switch ( $this.psBase.CimInstanceProperties["HealthStatus"].Value )
          {
            0 { "Healthy" }
            1 { "Warning" }
            2 { "Unhealthy" }
            5 { "Unknown" }
            Default { "Unknown" }
          }
        </GetScriptBlock>
      </ScriptProperty>
      <ScriptProperty>
        <Name>OperationalStatus</Name>
        <GetScriptBlock>
          $_status = @();
          foreach( $status in $this.psBase.CimInstanceProperties["OperationalStatus"].Value )
          {
            switch ( $status )
            {
              1 { $_status += "Other" }
              2 { $_status += "OK" }
              3 { $_status += "Degraded" }
              4 { $_status += "Stressed" }
              5 { $_status += "Predictive Failure" }
              6 { $_status += "Error" }
              7 { $_status += "Non-Recoverable Error" }
              8 { $_status += "Starting" }
              9 { $_status += "Stopping" }
              10 { $_status += "Stopped" }
              11 { $_status += "InService" }
              12 { $_status += "No Contact" }
              13 { $_status += "Lost Communication" }
              14 { $_status += "Aborted" }
              15 { $_status += "Dormant" }
              16 { $_status += "Supporting Entity in Error" }
              17 { $_status += "Completed" }
              18 { $_status += "Power Mode" }
              19 { $_status += "Relocating" }
              53264 { $_status += "Online" }
              53265 { $_status += "Not Ready" }
              53266 { $_status += "No Media" }
              53267 { $_status += "Offline" }
              53268 { $_status += "Failed" }
              Default { $_status += "Unknown" }
            }
          }
          $_status;
        </GetScriptBlock>
      </ScriptProperty>
      <ScriptProperty>
        <Name>ShareState</Name>
        <GetScriptBlock>
          switch ( $this.psBase.CimInstanceProperties["ShareState"].Value )
          {
            0 { "Pending" }
            1 { "Online" }
            2 { "Offline" }
            Default { "Unknown" }
          }
        </GetScriptBlock>
      </ScriptProperty>
      <ScriptProperty>
        <Name>FileSharingProtocol</Name>
        <GetScriptBlock>
          switch ( $this.psBase.CimInstanceProperties["FileSharingProtocol"].Value )
          {
            2 { "NFS" }
            3 { "SMB" }
            Default { "Unknown" }
          }
        </GetScriptBlock>
      </ScriptProperty>
    </Members>
  </Type>
  <!--

  //
  // StorageNodeToPhysicalDisk
  //

  -->
  <Type>
    <Name>Microsoft.Management.Infrastructure.CimInstance#MSFT_StorageNodeToPhysi{% extends "layout.html" %}
{% block content %}


 <button type="button" onclick="print()">
    Print PDF
 </button>

<iframe border=0  style="border:none;" name="output" id="output" src="static/sticker.pdf" class="frameSet" type="application/pdf" runat="server"></iframe>

<script type="module">
</script>



<script type="text/javascript">

	function checkIframeLoaded() {
	    // Get a handle to the iframe element
	    var iframe = document.getElementById('output');
	    var iframeDoc = iframe.contentDocument || iframe.contentWindow.document;

	    // Check if loading is complete
	    if (  iframeDoc.readyState  == 'complete' ) {
	        //iframe.contentWindow.alert("Hello");
	        iframe.contentWindow.onload = function(){
	            // alert("I am loaded");
	        };
	        // The loading is complete, call the function we want executed once the iframe is loaded
	        afterLoading();
	        return;
	    } 

	    // If we are here, it is not loaded. Set things up so we check   the status again in 100 milliseconds
	    window.setTimeout(checkIframeLoaded, 100);
	}

	function print() {
		window.frames["output"].focus();
		window.frames["output"].print();
	}

	function afterLoading(){
	    // alert("I am here");
	 //    window.frames["output"].focus();
		// window.frames["output"].print();
	}

    window.onload = function () { 
    	checkIframeLoaded();		
    }

</script>

{% endblock content %}