Update teedy.ps1

functional multi-tag add-documents and recursive directory uploading/tagging
This commit is contained in:
paradizelost 2020-12-17 04:10:54 -06:00 committed by GitHub
parent 480ce4920e
commit 1c2eb8c07d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -187,7 +187,8 @@ function Add-Directory(){
$AnchorTag='DirUploadTest',
$Directory='C:\Users\dan\teedytest',
[switch]$DontUseExistingTags,
[switch]$OnlyCreateTags
[switch]$OnlyCreateTags,
$Tags
)
Update-TagHash
if(-not($taghash[$AnchorTag])){
@ -215,9 +216,9 @@ function Add-Directory(){
$files = get-childitem -Path $mydirectory.FullName -File | select-object -ExpandProperty FullName
if($files.count -gt 0){
if((split-path $files[0] -parent) -eq $Directory){
New-Document -title $mydirectory.FullName -tag $AnchorTag -file $files
New-Document -title $mydirectory.FullName -tags @($AnchorTag,$tags) -file $files
} else {
New-Document -title $mydirectory.FullName -tag $newtagname -file $files
New-Document -title $mydirectory.FullName -tags @($newtagname,$tags) -file $files
}
}
}