Convert list items into a grid view












0















I would like a matrix / gridview of all my servers with the hotfixes installed. I query each server and get a list like this:



host1, fix1
host1, fix2
host1, fix3
host2, fix1
host3, fix1
host3, fix2


My grid would ideally look like:



HOSTS, fix1, fix2, fix3
host1, Yes, Yes, Yes
host2, Yes, No, No
host3, Yes, Yes, No


I think I should do this creating severall loops, but I usualy make a row like this:



$row = "" | Select Name, item1, item2


However, in this case, I don't know the number of items before I run the script. How can I size the $row dynamically?



***** EDIT *****
Created this version of the script by Mathias R. Jessen:



$ListOfAllHotfixes = @()
$fixesOnHosts = @()
$totalview = @()
$hyplist = Get-SCVMHostCluster -Name "CLH-LGF-CTX" | Get-SCVMHost

foreach( $hyphost in $hyplist)
{
$hotfixlist = Get-HotFix -ComputerName $hyphost # Per host a list off installed hotfixes
Foreach( $hotfix in $hotfixlist)
{
# Create list of just hotfixes to compare to later on
$ListOfAllHotfixes += $hotfix.hotfixid
# Create rows of hotfixes per host
$Row = "" | Select hostname, hotfix
$row.hostname = $hotfix.PSComputerName
$row.hotfix = $hotfix.HotFixID

$FixesOnHosts += $row }
}

# $ListOfAllHotfixes is now filled with all fixes per host, let's make it unique on hotfixid
$ListOfAllHotfixes = ($ListOfAllHotfixes | Sort-Object -Unique)

# Result = $FixesOnHosts = all hosts and all their hotfixes
# Result = $ListOffAllHotfixes = unique list of the hotfixes

$HotfixesPerHost = @{}
foreach($Hotfix in $FixesOnHosts)
{
$HotfixesPerHost[$Hotfix.Hostname] += @($Hotfix.Hotfix)
write-host "Host = " $Hotfix.Hostname
write-host "Hotfix = " $hotfix.hotfix
}


foreach($HypHost in $HotfixesPerHost.Keys)
{
$Properties = [ordered]@{ Hostname = $HypHost }
foreach($Hotfix in $ListOfAllHotfixes)
{
$Properties[$Hotfix] = $HotfixesPerHost[$HypHost] -contains $Hotfix
}
[pscustomobject]$Properties
}


However the result is like this:



Hostname  : VCDHYP636
KB2843630 : True
KB2868626 : True
KB2883200 : True
KB2887595 : True
KB2893294 : True


(25 lines of hotfixes)



Hostname  : VCDHYP609
KB2843630 : False
KB2868626 : False
KB2883200 : False
KB2887595 : False
KB2893294 : False
KB2894852 : True
KB2894856 : True









share|improve this question





























    0















    I would like a matrix / gridview of all my servers with the hotfixes installed. I query each server and get a list like this:



    host1, fix1
    host1, fix2
    host1, fix3
    host2, fix1
    host3, fix1
    host3, fix2


    My grid would ideally look like:



    HOSTS, fix1, fix2, fix3
    host1, Yes, Yes, Yes
    host2, Yes, No, No
    host3, Yes, Yes, No


    I think I should do this creating severall loops, but I usualy make a row like this:



    $row = "" | Select Name, item1, item2


    However, in this case, I don't know the number of items before I run the script. How can I size the $row dynamically?



    ***** EDIT *****
    Created this version of the script by Mathias R. Jessen:



    $ListOfAllHotfixes = @()
    $fixesOnHosts = @()
    $totalview = @()
    $hyplist = Get-SCVMHostCluster -Name "CLH-LGF-CTX" | Get-SCVMHost

    foreach( $hyphost in $hyplist)
    {
    $hotfixlist = Get-HotFix -ComputerName $hyphost # Per host a list off installed hotfixes
    Foreach( $hotfix in $hotfixlist)
    {
    # Create list of just hotfixes to compare to later on
    $ListOfAllHotfixes += $hotfix.hotfixid
    # Create rows of hotfixes per host
    $Row = "" | Select hostname, hotfix
    $row.hostname = $hotfix.PSComputerName
    $row.hotfix = $hotfix.HotFixID

    $FixesOnHosts += $row }
    }

    # $ListOfAllHotfixes is now filled with all fixes per host, let's make it unique on hotfixid
    $ListOfAllHotfixes = ($ListOfAllHotfixes | Sort-Object -Unique)

    # Result = $FixesOnHosts = all hosts and all their hotfixes
    # Result = $ListOffAllHotfixes = unique list of the hotfixes

    $HotfixesPerHost = @{}
    foreach($Hotfix in $FixesOnHosts)
    {
    $HotfixesPerHost[$Hotfix.Hostname] += @($Hotfix.Hotfix)
    write-host "Host = " $Hotfix.Hostname
    write-host "Hotfix = " $hotfix.hotfix
    }


    foreach($HypHost in $HotfixesPerHost.Keys)
    {
    $Properties = [ordered]@{ Hostname = $HypHost }
    foreach($Hotfix in $ListOfAllHotfixes)
    {
    $Properties[$Hotfix] = $HotfixesPerHost[$HypHost] -contains $Hotfix
    }
    [pscustomobject]$Properties
    }


    However the result is like this:



    Hostname  : VCDHYP636
    KB2843630 : True
    KB2868626 : True
    KB2883200 : True
    KB2887595 : True
    KB2893294 : True


    (25 lines of hotfixes)



    Hostname  : VCDHYP609
    KB2843630 : False
    KB2868626 : False
    KB2883200 : False
    KB2887595 : False
    KB2893294 : False
    KB2894852 : True
    KB2894856 : True









    share|improve this question



























      0












      0








      0


      1






      I would like a matrix / gridview of all my servers with the hotfixes installed. I query each server and get a list like this:



      host1, fix1
      host1, fix2
      host1, fix3
      host2, fix1
      host3, fix1
      host3, fix2


      My grid would ideally look like:



      HOSTS, fix1, fix2, fix3
      host1, Yes, Yes, Yes
      host2, Yes, No, No
      host3, Yes, Yes, No


      I think I should do this creating severall loops, but I usualy make a row like this:



      $row = "" | Select Name, item1, item2


      However, in this case, I don't know the number of items before I run the script. How can I size the $row dynamically?



      ***** EDIT *****
      Created this version of the script by Mathias R. Jessen:



      $ListOfAllHotfixes = @()
      $fixesOnHosts = @()
      $totalview = @()
      $hyplist = Get-SCVMHostCluster -Name "CLH-LGF-CTX" | Get-SCVMHost

      foreach( $hyphost in $hyplist)
      {
      $hotfixlist = Get-HotFix -ComputerName $hyphost # Per host a list off installed hotfixes
      Foreach( $hotfix in $hotfixlist)
      {
      # Create list of just hotfixes to compare to later on
      $ListOfAllHotfixes += $hotfix.hotfixid
      # Create rows of hotfixes per host
      $Row = "" | Select hostname, hotfix
      $row.hostname = $hotfix.PSComputerName
      $row.hotfix = $hotfix.HotFixID

      $FixesOnHosts += $row }
      }

      # $ListOfAllHotfixes is now filled with all fixes per host, let's make it unique on hotfixid
      $ListOfAllHotfixes = ($ListOfAllHotfixes | Sort-Object -Unique)

      # Result = $FixesOnHosts = all hosts and all their hotfixes
      # Result = $ListOffAllHotfixes = unique list of the hotfixes

      $HotfixesPerHost = @{}
      foreach($Hotfix in $FixesOnHosts)
      {
      $HotfixesPerHost[$Hotfix.Hostname] += @($Hotfix.Hotfix)
      write-host "Host = " $Hotfix.Hostname
      write-host "Hotfix = " $hotfix.hotfix
      }


      foreach($HypHost in $HotfixesPerHost.Keys)
      {
      $Properties = [ordered]@{ Hostname = $HypHost }
      foreach($Hotfix in $ListOfAllHotfixes)
      {
      $Properties[$Hotfix] = $HotfixesPerHost[$HypHost] -contains $Hotfix
      }
      [pscustomobject]$Properties
      }


      However the result is like this:



      Hostname  : VCDHYP636
      KB2843630 : True
      KB2868626 : True
      KB2883200 : True
      KB2887595 : True
      KB2893294 : True


      (25 lines of hotfixes)



      Hostname  : VCDHYP609
      KB2843630 : False
      KB2868626 : False
      KB2883200 : False
      KB2887595 : False
      KB2893294 : False
      KB2894852 : True
      KB2894856 : True









      share|improve this question
















      I would like a matrix / gridview of all my servers with the hotfixes installed. I query each server and get a list like this:



      host1, fix1
      host1, fix2
      host1, fix3
      host2, fix1
      host3, fix1
      host3, fix2


      My grid would ideally look like:



      HOSTS, fix1, fix2, fix3
      host1, Yes, Yes, Yes
      host2, Yes, No, No
      host3, Yes, Yes, No


      I think I should do this creating severall loops, but I usualy make a row like this:



      $row = "" | Select Name, item1, item2


      However, in this case, I don't know the number of items before I run the script. How can I size the $row dynamically?



      ***** EDIT *****
      Created this version of the script by Mathias R. Jessen:



      $ListOfAllHotfixes = @()
      $fixesOnHosts = @()
      $totalview = @()
      $hyplist = Get-SCVMHostCluster -Name "CLH-LGF-CTX" | Get-SCVMHost

      foreach( $hyphost in $hyplist)
      {
      $hotfixlist = Get-HotFix -ComputerName $hyphost # Per host a list off installed hotfixes
      Foreach( $hotfix in $hotfixlist)
      {
      # Create list of just hotfixes to compare to later on
      $ListOfAllHotfixes += $hotfix.hotfixid
      # Create rows of hotfixes per host
      $Row = "" | Select hostname, hotfix
      $row.hostname = $hotfix.PSComputerName
      $row.hotfix = $hotfix.HotFixID

      $FixesOnHosts += $row }
      }

      # $ListOfAllHotfixes is now filled with all fixes per host, let's make it unique on hotfixid
      $ListOfAllHotfixes = ($ListOfAllHotfixes | Sort-Object -Unique)

      # Result = $FixesOnHosts = all hosts and all their hotfixes
      # Result = $ListOffAllHotfixes = unique list of the hotfixes

      $HotfixesPerHost = @{}
      foreach($Hotfix in $FixesOnHosts)
      {
      $HotfixesPerHost[$Hotfix.Hostname] += @($Hotfix.Hotfix)
      write-host "Host = " $Hotfix.Hostname
      write-host "Hotfix = " $hotfix.hotfix
      }


      foreach($HypHost in $HotfixesPerHost.Keys)
      {
      $Properties = [ordered]@{ Hostname = $HypHost }
      foreach($Hotfix in $ListOfAllHotfixes)
      {
      $Properties[$Hotfix] = $HotfixesPerHost[$HypHost] -contains $Hotfix
      }
      [pscustomobject]$Properties
      }


      However the result is like this:



      Hostname  : VCDHYP636
      KB2843630 : True
      KB2868626 : True
      KB2883200 : True
      KB2887595 : True
      KB2893294 : True


      (25 lines of hotfixes)



      Hostname  : VCDHYP609
      KB2843630 : False
      KB2868626 : False
      KB2883200 : False
      KB2887595 : False
      KB2893294 : False
      KB2894852 : True
      KB2894856 : True






      powershell






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 20 '18 at 14:54







      Gabrie

















      asked Nov 20 '18 at 8:10









      GabrieGabrie

      19812




      19812
























          1 Answer
          1






          active

          oldest

          votes


















          3














          To find out how many individual properties (or "columns") you need to specify, start by finding all distinct hotfixes - you can do this with Sort-Object:



          $Hotfixes = @'
          host1, fix1
          host1, fix2
          host1, fix3
          host2, fix1
          host3, fix1
          host3, fix2
          '@ |ConvertFrom-Csv -Header Hostname,Hotfix

          $DistinctHotfixes = $Hotfixes.Hotfix |Sort-Object -Unique


          Now that we know which properties to create for each host, we just need an easy way of figuring out whether a given host has a specific hotfix installed or not.



          We can easily do this by organizing all the entries by hostname:



          $HotfixesPerHost = @{}
          foreach($Hotfix in $Hotfixes){
          $HotfixesPerHost[$Hotfix.Hostname] += @($Hotfix.Hotfix)
          }


          Now we just need to generate the list of objects for our "matrix":



          foreach($Hostname in $HotfixesPerHost.Keys){
          $Properties = [ordered]@{
          Hostname = $Hostname
          }
          foreach($Hotfix in $DistinctHotfixes){
          $Properties[$Hotfix] = $HotfixesPerHost[$Hostname] -contains $Hotfix
          }
          [pscustomobject]$Properties
          }


          And we end up with a nice list of hosts that, when piped to Format-Table, looks like this:



          Hostname fix1  fix2  fix3
          -------- ---- ---- ----
          host3 True True False
          host1 True True True
          host2 True False False





          share|improve this answer
























          • Thank you for your extensive help. Your example works, but when I try to adept it to my situation it somehow goes wrong. Not sure if I'm mixing objects and strings, but the $properties export looks like this: Name,Value --------- Hostname,VCDHYP609 KB2843630,False KB2868626,False KB2883200,False KB2887595,False KB2893294,False Can't get the formatting to work, but it is in a single table

            – Gabrie
            Nov 20 '18 at 12:40













          • Don't forget the last step (converting it into an object): [pscustomobject]$Properties

            – Mathias R. Jessen
            Nov 20 '18 at 12:47











          • Yes, using that, but somehow the first line is the header line. You see first line is: name, value. Second line is hostname, vcdhyp609 (which is the server name). Third line is hotfix and true/false.

            – Gabrie
            Nov 20 '18 at 12:57











          • If the "headers" are coming out as "Name" and "Value", it's because you haven't converted the hashtable to objects yet :)

            – Mathias R. Jessen
            Nov 20 '18 at 12:59











          • Changed my question to reflect my script based on yours. Can't see where my version is going wrong.

            – Gabrie
            Nov 20 '18 at 14:39











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53388687%2fconvert-list-items-into-a-grid-view%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          3














          To find out how many individual properties (or "columns") you need to specify, start by finding all distinct hotfixes - you can do this with Sort-Object:



          $Hotfixes = @'
          host1, fix1
          host1, fix2
          host1, fix3
          host2, fix1
          host3, fix1
          host3, fix2
          '@ |ConvertFrom-Csv -Header Hostname,Hotfix

          $DistinctHotfixes = $Hotfixes.Hotfix |Sort-Object -Unique


          Now that we know which properties to create for each host, we just need an easy way of figuring out whether a given host has a specific hotfix installed or not.



          We can easily do this by organizing all the entries by hostname:



          $HotfixesPerHost = @{}
          foreach($Hotfix in $Hotfixes){
          $HotfixesPerHost[$Hotfix.Hostname] += @($Hotfix.Hotfix)
          }


          Now we just need to generate the list of objects for our "matrix":



          foreach($Hostname in $HotfixesPerHost.Keys){
          $Properties = [ordered]@{
          Hostname = $Hostname
          }
          foreach($Hotfix in $DistinctHotfixes){
          $Properties[$Hotfix] = $HotfixesPerHost[$Hostname] -contains $Hotfix
          }
          [pscustomobject]$Properties
          }


          And we end up with a nice list of hosts that, when piped to Format-Table, looks like this:



          Hostname fix1  fix2  fix3
          -------- ---- ---- ----
          host3 True True False
          host1 True True True
          host2 True False False





          share|improve this answer
























          • Thank you for your extensive help. Your example works, but when I try to adept it to my situation it somehow goes wrong. Not sure if I'm mixing objects and strings, but the $properties export looks like this: Name,Value --------- Hostname,VCDHYP609 KB2843630,False KB2868626,False KB2883200,False KB2887595,False KB2893294,False Can't get the formatting to work, but it is in a single table

            – Gabrie
            Nov 20 '18 at 12:40













          • Don't forget the last step (converting it into an object): [pscustomobject]$Properties

            – Mathias R. Jessen
            Nov 20 '18 at 12:47











          • Yes, using that, but somehow the first line is the header line. You see first line is: name, value. Second line is hostname, vcdhyp609 (which is the server name). Third line is hotfix and true/false.

            – Gabrie
            Nov 20 '18 at 12:57











          • If the "headers" are coming out as "Name" and "Value", it's because you haven't converted the hashtable to objects yet :)

            – Mathias R. Jessen
            Nov 20 '18 at 12:59











          • Changed my question to reflect my script based on yours. Can't see where my version is going wrong.

            – Gabrie
            Nov 20 '18 at 14:39
















          3














          To find out how many individual properties (or "columns") you need to specify, start by finding all distinct hotfixes - you can do this with Sort-Object:



          $Hotfixes = @'
          host1, fix1
          host1, fix2
          host1, fix3
          host2, fix1
          host3, fix1
          host3, fix2
          '@ |ConvertFrom-Csv -Header Hostname,Hotfix

          $DistinctHotfixes = $Hotfixes.Hotfix |Sort-Object -Unique


          Now that we know which properties to create for each host, we just need an easy way of figuring out whether a given host has a specific hotfix installed or not.



          We can easily do this by organizing all the entries by hostname:



          $HotfixesPerHost = @{}
          foreach($Hotfix in $Hotfixes){
          $HotfixesPerHost[$Hotfix.Hostname] += @($Hotfix.Hotfix)
          }


          Now we just need to generate the list of objects for our "matrix":



          foreach($Hostname in $HotfixesPerHost.Keys){
          $Properties = [ordered]@{
          Hostname = $Hostname
          }
          foreach($Hotfix in $DistinctHotfixes){
          $Properties[$Hotfix] = $HotfixesPerHost[$Hostname] -contains $Hotfix
          }
          [pscustomobject]$Properties
          }


          And we end up with a nice list of hosts that, when piped to Format-Table, looks like this:



          Hostname fix1  fix2  fix3
          -------- ---- ---- ----
          host3 True True False
          host1 True True True
          host2 True False False





          share|improve this answer
























          • Thank you for your extensive help. Your example works, but when I try to adept it to my situation it somehow goes wrong. Not sure if I'm mixing objects and strings, but the $properties export looks like this: Name,Value --------- Hostname,VCDHYP609 KB2843630,False KB2868626,False KB2883200,False KB2887595,False KB2893294,False Can't get the formatting to work, but it is in a single table

            – Gabrie
            Nov 20 '18 at 12:40













          • Don't forget the last step (converting it into an object): [pscustomobject]$Properties

            – Mathias R. Jessen
            Nov 20 '18 at 12:47











          • Yes, using that, but somehow the first line is the header line. You see first line is: name, value. Second line is hostname, vcdhyp609 (which is the server name). Third line is hotfix and true/false.

            – Gabrie
            Nov 20 '18 at 12:57











          • If the "headers" are coming out as "Name" and "Value", it's because you haven't converted the hashtable to objects yet :)

            – Mathias R. Jessen
            Nov 20 '18 at 12:59











          • Changed my question to reflect my script based on yours. Can't see where my version is going wrong.

            – Gabrie
            Nov 20 '18 at 14:39














          3












          3








          3







          To find out how many individual properties (or "columns") you need to specify, start by finding all distinct hotfixes - you can do this with Sort-Object:



          $Hotfixes = @'
          host1, fix1
          host1, fix2
          host1, fix3
          host2, fix1
          host3, fix1
          host3, fix2
          '@ |ConvertFrom-Csv -Header Hostname,Hotfix

          $DistinctHotfixes = $Hotfixes.Hotfix |Sort-Object -Unique


          Now that we know which properties to create for each host, we just need an easy way of figuring out whether a given host has a specific hotfix installed or not.



          We can easily do this by organizing all the entries by hostname:



          $HotfixesPerHost = @{}
          foreach($Hotfix in $Hotfixes){
          $HotfixesPerHost[$Hotfix.Hostname] += @($Hotfix.Hotfix)
          }


          Now we just need to generate the list of objects for our "matrix":



          foreach($Hostname in $HotfixesPerHost.Keys){
          $Properties = [ordered]@{
          Hostname = $Hostname
          }
          foreach($Hotfix in $DistinctHotfixes){
          $Properties[$Hotfix] = $HotfixesPerHost[$Hostname] -contains $Hotfix
          }
          [pscustomobject]$Properties
          }


          And we end up with a nice list of hosts that, when piped to Format-Table, looks like this:



          Hostname fix1  fix2  fix3
          -------- ---- ---- ----
          host3 True True False
          host1 True True True
          host2 True False False





          share|improve this answer













          To find out how many individual properties (or "columns") you need to specify, start by finding all distinct hotfixes - you can do this with Sort-Object:



          $Hotfixes = @'
          host1, fix1
          host1, fix2
          host1, fix3
          host2, fix1
          host3, fix1
          host3, fix2
          '@ |ConvertFrom-Csv -Header Hostname,Hotfix

          $DistinctHotfixes = $Hotfixes.Hotfix |Sort-Object -Unique


          Now that we know which properties to create for each host, we just need an easy way of figuring out whether a given host has a specific hotfix installed or not.



          We can easily do this by organizing all the entries by hostname:



          $HotfixesPerHost = @{}
          foreach($Hotfix in $Hotfixes){
          $HotfixesPerHost[$Hotfix.Hostname] += @($Hotfix.Hotfix)
          }


          Now we just need to generate the list of objects for our "matrix":



          foreach($Hostname in $HotfixesPerHost.Keys){
          $Properties = [ordered]@{
          Hostname = $Hostname
          }
          foreach($Hotfix in $DistinctHotfixes){
          $Properties[$Hotfix] = $HotfixesPerHost[$Hostname] -contains $Hotfix
          }
          [pscustomobject]$Properties
          }


          And we end up with a nice list of hosts that, when piped to Format-Table, looks like this:



          Hostname fix1  fix2  fix3
          -------- ---- ---- ----
          host3 True True False
          host1 True True True
          host2 True False False






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 20 '18 at 8:30









          Mathias R. JessenMathias R. Jessen

          56.9k458103




          56.9k458103













          • Thank you for your extensive help. Your example works, but when I try to adept it to my situation it somehow goes wrong. Not sure if I'm mixing objects and strings, but the $properties export looks like this: Name,Value --------- Hostname,VCDHYP609 KB2843630,False KB2868626,False KB2883200,False KB2887595,False KB2893294,False Can't get the formatting to work, but it is in a single table

            – Gabrie
            Nov 20 '18 at 12:40













          • Don't forget the last step (converting it into an object): [pscustomobject]$Properties

            – Mathias R. Jessen
            Nov 20 '18 at 12:47











          • Yes, using that, but somehow the first line is the header line. You see first line is: name, value. Second line is hostname, vcdhyp609 (which is the server name). Third line is hotfix and true/false.

            – Gabrie
            Nov 20 '18 at 12:57











          • If the "headers" are coming out as "Name" and "Value", it's because you haven't converted the hashtable to objects yet :)

            – Mathias R. Jessen
            Nov 20 '18 at 12:59











          • Changed my question to reflect my script based on yours. Can't see where my version is going wrong.

            – Gabrie
            Nov 20 '18 at 14:39



















          • Thank you for your extensive help. Your example works, but when I try to adept it to my situation it somehow goes wrong. Not sure if I'm mixing objects and strings, but the $properties export looks like this: Name,Value --------- Hostname,VCDHYP609 KB2843630,False KB2868626,False KB2883200,False KB2887595,False KB2893294,False Can't get the formatting to work, but it is in a single table

            – Gabrie
            Nov 20 '18 at 12:40













          • Don't forget the last step (converting it into an object): [pscustomobject]$Properties

            – Mathias R. Jessen
            Nov 20 '18 at 12:47











          • Yes, using that, but somehow the first line is the header line. You see first line is: name, value. Second line is hostname, vcdhyp609 (which is the server name). Third line is hotfix and true/false.

            – Gabrie
            Nov 20 '18 at 12:57











          • If the "headers" are coming out as "Name" and "Value", it's because you haven't converted the hashtable to objects yet :)

            – Mathias R. Jessen
            Nov 20 '18 at 12:59











          • Changed my question to reflect my script based on yours. Can't see where my version is going wrong.

            – Gabrie
            Nov 20 '18 at 14:39

















          Thank you for your extensive help. Your example works, but when I try to adept it to my situation it somehow goes wrong. Not sure if I'm mixing objects and strings, but the $properties export looks like this: Name,Value --------- Hostname,VCDHYP609 KB2843630,False KB2868626,False KB2883200,False KB2887595,False KB2893294,False Can't get the formatting to work, but it is in a single table

          – Gabrie
          Nov 20 '18 at 12:40







          Thank you for your extensive help. Your example works, but when I try to adept it to my situation it somehow goes wrong. Not sure if I'm mixing objects and strings, but the $properties export looks like this: Name,Value --------- Hostname,VCDHYP609 KB2843630,False KB2868626,False KB2883200,False KB2887595,False KB2893294,False Can't get the formatting to work, but it is in a single table

          – Gabrie
          Nov 20 '18 at 12:40















          Don't forget the last step (converting it into an object): [pscustomobject]$Properties

          – Mathias R. Jessen
          Nov 20 '18 at 12:47





          Don't forget the last step (converting it into an object): [pscustomobject]$Properties

          – Mathias R. Jessen
          Nov 20 '18 at 12:47













          Yes, using that, but somehow the first line is the header line. You see first line is: name, value. Second line is hostname, vcdhyp609 (which is the server name). Third line is hotfix and true/false.

          – Gabrie
          Nov 20 '18 at 12:57





          Yes, using that, but somehow the first line is the header line. You see first line is: name, value. Second line is hostname, vcdhyp609 (which is the server name). Third line is hotfix and true/false.

          – Gabrie
          Nov 20 '18 at 12:57













          If the "headers" are coming out as "Name" and "Value", it's because you haven't converted the hashtable to objects yet :)

          – Mathias R. Jessen
          Nov 20 '18 at 12:59





          If the "headers" are coming out as "Name" and "Value", it's because you haven't converted the hashtable to objects yet :)

          – Mathias R. Jessen
          Nov 20 '18 at 12:59













          Changed my question to reflect my script based on yours. Can't see where my version is going wrong.

          – Gabrie
          Nov 20 '18 at 14:39





          Changed my question to reflect my script based on yours. Can't see where my version is going wrong.

          – Gabrie
          Nov 20 '18 at 14:39


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53388687%2fconvert-list-items-into-a-grid-view%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          MongoDB - Not Authorized To Execute Command

          How to fix TextFormField cause rebuild widget in Flutter

          Npm cannot find a required file even through it is in the searched directory