Note that there are some explanatory texts on larger screens.

plurals
  1. POBest way to handle large amount of nested data in powershell?
    primarykey
    data
    text
    <p>I'm trying to automate the logfiles verification of our daily batch. </p> <p>I want to check around 20 servers that may have up to 30 batch, each batch can generate one or more logfiles and I want to validate them using several criteria.<br> So this ends up with a quite huge amount of data. </p> <p>My first though was to use nested arrays and hashtables then create psobject like this :</p> <pre><code>$servers=@( @{ "name"="server1"; "credential"="domain\user"; "batch"=@( @{"batchName"="test";"path"="e:\cit\sauvegarde\batch\recup.cmd";"comment"="batch de test";"schedule"="lundi,mardi "; "validations"=@( @{"name"="log exist";"path"="\\smacweb\e$\cit\test.log";"filter"=@("NotNull";"NotOlderThan,2") }; @{"name"="no erros";"path"="\\smacweb\CIT\sauvegarde\logs\*.log";"filter"=@("NotContains,'error'") }; )}; @{"batchName"="mysql";"comment"="dump des bases mysql";"schedule"="lundi,mardi,vendredi"; "validations"=@( @{"name"="log exist";"path"="\\smacweb\e$\mysqldump\dump.zip";"filter"=@("NotNull";"NotOlderThan,2") }; @{"name"="zipOK";"path"="\\smacweb\e$\mysqldump\dump.zip";"filter"=@("Test-Zip") }; )}; ) }; # @{ # "name"="server2"; # "credential"="domain\user2"; # "batch"=@( # @{"batchName"=.....}; # )}; ) $srv=@() $servers | % { $srv+= New-Object -TypeName psobject -Property $_; } </code></pre> <p>This is a small example but I guess it will quickly become hardly readable. So what would be a better way to do this? Use xml (not familiar to me), use external database, other method?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload