November 2018
Intermediate to advanced
566 pages
17h 15m
English
Our task is simple. We are only going to write the code block that will take the input and separate the various fields into variables. The exclusion list should be a single array variable. When displaying the output, we will display each exclusion path on separate lines. Follow these steps to complete this recipe:
PS> $PathInfo = Import-Csv './ch06/07-input.csv' PS> # Looping construct here PS> $ExclusionPaths = $PathInfo.Exclusion -split ';'PS> # Some code block to handle deletion and other thingsPS> Write-Host "These $($ExclusionPaths.Count) paths will be excluded from deletion: $($ExclusionPaths -join ', ')"PS> # End loop
Read now
Unlock full access