-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathShredXMLCohort.ps1
More file actions
32 lines (28 loc) · 915 Bytes
/
ShredXMLCohort.ps1
File metadata and controls
32 lines (28 loc) · 915 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<# ---------------------------------------------------------
For each sample directory not control extract the xml file
formats
---------------------------------------------------------#>
Function ShredXMLCohort {
param ($root)
$sample_all = Get-ChildItem -Path $root -Directory
#
foreach ($sub in $sample_all) {
$IM3_fd = $root + "\" + $sub.Name + "\im3\"
$ii = test-path -path $IM3_fd
#
$XML_fd = $root + "\" + $sub.Name + "\im3\xml\"
$ii2 = test-path -path $XML_fd
#
IF (!$ii -or $sub.Name -like "Control*" -or $ii2) {
Continue
}
#
$code = $PSScriptRoot + '\ConvertIM3Path.ps1'
& $code $root $XML_fd $sub -s -xml
#
$sor = $XML_fd + "\" + $sub.Name
XCOPY $sor $XML_fd /q /y /z > NULL
Remove-Item $sor -Recurse
}
#
}